You have syntax error. You don’t need single quote for column name.
You can use phpmyadmin to test MySQL queries.
$sql = "CREATE TABLE IF NOT EXISTS $table_name (
id INT(6) NOT NULL AUTO_INCREMENT ,
user_id TEXT NOT NULL,
full_name TEXT NOT NULL,
email TEXT NOT NULL,
invoiceNumber TEXT NOT NULL,
plan_type TEXT NOT NULL,
date TEXT NOT NULL,
membership_type TEXT NOT NULL,
plan_price INT NOT NULL,
currency TEXT NOT NULL,
payment_method TEXT NOT NULL,
status TEXT NOT NULL,
PRIMARY KEY (id)
)";
Related Posts:
- Does dbDelta delete columns as well?
- How to define composite keys with dbDelta()
- Fatal error: Call to undefined function dbDelta()
- Why does dbDelta() not catch MysqlErrors?
- Is altering a default WordPress database table update safe?
- Unable to set a default serialized array using dbdelta()
- Create table with dbDelta,can’t put any DEFAULT data
- Print output of Table Creation
- WordPress dbdelta a semicolon
- What is this JavaScript “require”?
- How can I make updates to a site, on a development copy, but then move updates back without overriding live site’s evolving database?
- get_results using wpdb
- How can I make a WordPress database portable and url independent?
- wpdb->insert multiple record at once
- How to migrate a HTTPS WordPress installation to localhost?
- How to stop WordPress using utf8mb4_unicode_520_ci collation?
- How to monitor server for error establishing a database connection
- WP_Options ID high
- Default WordPress settings API data sanitization
- Connect to remote database using Localhost install
- remove missing image attachments
- Transient RSS feeds in wp_options not removed automatically?
- Best way to move live site local
- The revisions table in my database is at 70% capacity and growing. What should I do?
- How to ensure data consistency in WordPress
- Database location in WordPress
- WooCommerce with thousands of products – site is very slow – optimize db queries? [closed]
- How to display data from custom table in wordpress database?
- How to intercept update_option() before it saves data?
- Change SQL get_results to search for posts with custom term in custom taxonomy
- wpdb query on custom table not working [closed]
- How to diagnose and keep in check encoding issues?
- Add search Value to wp_list_table pagination
- stdObject stored in database. How does one convert it to usable format?
- I have a table I created, how do I make a form for a user to filter the data?
- Set Display Name to first and last name (phpmyadmin SQL Query)
- How to fix unchanged URLs in Database after running serialized search and replace script?
- wp_redirection_404 table has grown to 7GB
- Does WordPress ever need multiple databases?
- WordPress database error – Error in SQL syntax – I can’t identify any error?
- Multiple wp_options tables to share content across installs
- Merging two wp_posts tables while avoiding duplicates
- Merging two databases without borking it
- Is there a smart way to obtain a list of only some selected user meta data?
- Why does importing copies of the database dump and the document root make WordPress data inconsistent?
- Permit Login if table row exists
- How Yoast SEO plugin works with variable %%name%%?
- What would Repair and Optimize WordPress Database do?
- Move out of sync posts from one database to another
- MS Access to manage WordPress Database
- Saving zero as meta value
- Query multiple tables at once?
- dbDelta not adding additional columns in plugin database update
- Custom WordPress Table wpdb
- $wpdb->get_results($wpdb->prepare(… You have an error in your SQL syntax;
- Transferring/Uploading Data from DB to WordPress
- Can local WordPress installs share /wp-content/ folder and database?
- how to encyrpt DB_PASSWORD in wp-config
- Choosing http or https during manual installation of WordPress and database
- Stringing together content from different databases
- Delete all posts that do NOT have a specific tag
- Changing order of db results when encoding to JSON
- How to transfer from localHost to live but use the already existing database on the server?
- Safely store code(html/js..) into database
- Why does wp_links still exist in the db schema?
- can’t upgrade wordpress or install plugins, it seems to “think” it’s still on a local installation
- How not to display ALL items of a database
- How to get the records from start with A to G in php and mysql
- Link multiple user databases together?
- I wanted to Know that how can I give ingore to 0000-00-00 in my config file
- Set a cron job to delete a specific database table table every midnight
- Two separate wordpress installations at one domain
- Is there any defects for using same database prefix in WordPress for multiple sites?
- Can we store password in without being hashing?
- How to import products in host instead of database on wordpress?
- I would like some help wth an SQL query to link posts with categories
- Error establishing a database connection in wordpress
- Where is the HTML-handler part in the wpdb class?
- How do I update a WordPress wp_postmeta meta_value that contains many options
- How can I get $wpdb to show MySQL warnings?
- How to display $wpdb->insert_id; value on redirected page
- Should I Use only wpdb Class to Write Custom Queries?
- Auto populate form fields based on serial input or pull listings from other websites?
- How to extract some part of WordPress full source code
- Error establishing a database connection for some files
- Hash user emails in database?
- Database Name Change
- Weird characters in title if it contain “ ”
- Where To Find bb_profile_data(); In bbPress?
- DB access blocked when initializing WP externally
- Saving data to database and exporting to excel
- Site does not work right, pages not showing up, even for root admin
- One information repeated on multiple locations on one site [closed]
- WordPress: Interact with Database Query Data and Login
- Showing Error(TAble already exist)
- Getting an error when trying to migrate to DV server from Grid with Media Temple [closed]
- wp_usermeta key problem
- How to properly configure SSL connection to remote azure database for running queries within a WordPress environment
- Database Queries are crashing the server
- Uploading to WordPress Database