Answers for "wordpress create table"

SQL
7

create table mysql

CREATE TABLE IF NOT EXISTS tasks (
    task_id INT AUTO_INCREMENT PRIMARY KEY,
    title VARCHAR(255) NOT NULL,
    start_date DATE,
    due_date DATE,
    status TINYINT NOT NULL,
    priority TINYINT NOT NULL,
    description TEXT,
    created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
)  ENGINE=INNODB;
Posted by: Guest on December-18-2019
1

create table in wordpress plugin

<?php
function table_create()
{
global $wpdb;
$table_name = $wpdb->prefix . "wpactable"; 
$charset_collate = $wpdb->get_charset_collate();
 $sql = "CREATE TABLE IF NOT EXISTS $table_name (
  id mediumint(9) NOT NULL AUTO_INCREMENT,
  name tinytext NOT NULL,
  email tinytext NOT NULL,
  number tinytext NOT NULL,
  Website text NOT NULL,
  PRIMARY KEY  (id)
) $charset_collate";
require_once( ABSPATH .'wp-admin/includes/upgrade.php' );
dbDelta( $sql );
}

?>
Posted by: Guest on January-25-2021
0

codeigniter create table

$forge->createTable('table_name', TRUE);
// gives CREATE TABLE IF NOT EXISTS table_name
Posted by: Guest on May-26-2020
0

how to create table in wordpress database

function myplugin_update_db_check() {
    global $jal_db_version;
    if ( get_site_option( 'jal_db_version' ) != $jal_db_version ) {
        jal_install();
    }
}
add_action( 'plugins_loaded', 'myplugin_update_db_check' );
Posted by: Guest on November-19-2020

Code answers related to "SQL"

Browse Popular Code Answers by Language