function jal_install() {
global $jal_db_version;
$sql = "CREATE TABLE IF NOT EXISTS WP_AWESOME_TABLES (
id mediumint(9) NOT NULL AUTO_INCREMENT,
PRIMARY KEY id (id)
);";
require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
dbDelta( $sql );
add_option( "jal_db_version", $jal_db_version );
}
register_activation_hook( _____FILE_____, 'jal_install' );
You have to hook the function. After activate the plugin table will created.
Related Posts:
- How to define composite keys with dbDelta()
- Why does dbDelta() not catch MysqlErrors?
- Is altering a default WordPress database table update safe?
- What causes the “max_user_connections” warning on WordPress frontend?
- Error establishing a database connection – with Debug Data
- SQL Error wp_commentmeta – incorrect table definition
- Error establishing database connection – high traffic?
- Trouble Migrating all data blog from WordPress.com to WordPress.org
- Unable to set a default serialized array using dbdelta()
- How to fix database error duplicate entry
- I imported an restore an database and It shows #1067 – Invalid default value for ‘user_registered’
- Hang Up Followed By Can’t select database
- Rename a table in MySQL
- How should I tackle –secure-file-priv in MySQL?
- Can’t connect to MySQL server on ‘127.0.0.1’ (10061) (2003)
- Can’t connect to MySQL server on ‘127.0.0.1’ (10061) (2003)
- Can’t connect to MySQL server on ‘127.0.0.1’ (10061) (2003)
- MySQL SELECT increment counter
- phpMyAdmin – Error > Incorrect format parameter?
- Failed to connect to mysql at 127.0.0.1:3306 with user root access denied for user ‘root’@’localhost'(using password:YES)
- Using wpdb to connect to a separate database
- MySQL Database User: Which Privileges are needed?
- Why is my database import losing text widget data?
- Will it break my site if I delete all transient records in wp_options table?
- Checking if Database Table exists
- WordPress (MyISAM) database is slow, should I switch to InnoDB?
- Please explain how WordPress works with MySQL character set and collation at a low level
- The MySQL alternatives: Do Percona Server and MariaDB work well with WordPress, and do they make WordPress go better?
- Get error messages when $wpdb->insert() returns false?
- Detecting errors generated by $wpdb->get_results()
- Does dbDelta delete columns as well?
- How to fetch Data in WordPress using MySQLi or $wpdb
- WordPress Database lost auto increment
- Connect to database using wordpress wp-config file
- wpdb->insert multiple record at once
- Reset Post IDs to less than 64bit integer
- How To Export/Import WordPress (MySQL) Database Properly Via Command-Line?
- Restoring WordPress posts from database only
- WordPress database scalability from the code perspective
- Resetting comment count
- Is it possible to define two databases for one installation?
- Does WordPress use the InnoDB engine for MySQL by default?
- $wpdb->prepare() warning in WordPress 3.5
- Slow wp_term_relationships query
- How to use “TRUNCATE TABLE” MySQL statement?
- Can I use MariaDB instead of MySQL in wordpress?
- Changing the Database Connection Error Message
- Fatal error: Call to undefined function dbDelta()
- Using Dynamic Data Pulled from a MySQL Table in a WordPress Page
- When importing database, it shows error
- WordPress for a very large website
- What are conventions about the schema of the $table_prefix
- Split WP install between 2 databases?
- Inserting Post Meta From SQL
- WooCommerce with thousands of products – site is very slow – optimize db queries? [closed]
- Migrating non-WordPress CMS to WordPress, lots of data to move — possible solutions?
- Is deleting orphaned wp_options entries safe?
- How to solve slow WordPress site caused by attachment_metadata
- Huge wp_options table
- “MySQL server has gone away” since update to 3.8
- Strange Deadlock database error for the query “Delete From wp_options”
- Delete all post meta except featured image
- WordPress showing install screen after max_questions error
- Custom DB_COLLATE (collation) value not working on fresh install?
- $wpdb variable throw this error Call to a member function get_results() on a non-object in
- what to do when your WordPress database is too large?
- Change all http to https in mysql databse?
- WooCommerce – Query for ordered products
- Large database causes slow load
- How to execute mulitple statement SQL queries using $wpdb->query?
- Delete duplicate rows from wordpress database where a column is duplicate in phpmyadmin
- Database slowdown after update to 3.4.1
- Can I transfer a mysql database to another site?
- WordPress and automated MySQL backups to a different host
- Database with mixed collation (utf8mb4 & utf8_general_ci)
- Query WordPress database by registered date and role
- MySQL Syntax Error upon restoring database from backup [closed]
- Tons of Twitter rows in my database
- Help running a MySQL query to update all wp_#_options tables in a Multisite install
- How to insert data into MySQL database from the form created in WordPress site
- Set Display Name to first and last name (phpmyadmin SQL Query)
- Size article thumbnails and retrieve them directly from database
- WordPress site uses MyISAM, should I switch to InnoDB necessary?
- Is it safe to convert tables from MyISAM to InnoDB?
- Emojis getting converted to “?”
- error establishing a database connection
- Migrating database / content of non-CMS site to WordPress
- Does WordPress ever need multiple databases?
- Why are no posts showing despite my apparently correct DB restoration?
- Select Multiple meta_value from WP DB; Single Query
- Delete all post meta except featured image Using SQL
- Which is more efficient? Using usermeta, or creating a new MySQL table?
- How do I properly update the WordPress database password?
- wpdb_prepare with multiple or condition
- Is it possible to split database tables using HyperDB?
- Adding new row to wp_post table
- WordPress Install and Database on separate hosting?
- Error: SELECT SQL_CALC_FOUND_ROWS
- What happens if I overwrite the current wp_options table with a backup from a week ago?
- WordPress mysql table double prefixes