dbDelta not CREATING TABLE

You are missing comma end of phone varchar(10) NOT NULL line, add comma end of line after that table will be created. I have tested https://prnt.sc/qgqmog function lapizzeria_database() { global $wpdb; global $lapizzeria_db_version; $lapizzeria_db_version = “1.0”; $table = $wpdb->prefix . ‘reservation’; $charset_collate = $wpdb->get_charset_collate(); //SQL Statement $sql = “CREATE TABLE $table ( id mediumint(9) NOT … Read more

cant insert data in a custom table in phpmyadmin

I would strongly suggest using AJAX for this purpose. Using “init” for inserting some data to your database is not a good solution. Here’s a good guide on how to do it with AJAX: https://webprogramo.com/how-to-create-an-ajax-form-in-wordpress/1156/

What is this? MySQL array?

WordPress stores meta and option values in a serialized format if they are objects or arrays. So what you have there is an array (a) with an integer (i) key 0 and a string (s) value with 82 characters.

SQL query to change custom field in WordPress database

Recommend a database backup before you do this. ** updated the statement to specify “Y”, empty string, or null ** global $wpdb; $wpdb->query( “update {$wpdb->postmeta} SET meta_value=”X” WHERE meta_key = ‘old_price’ AND ( meta_value=”Y” OR meta_value=”” OR meta_value IS NULL ) );” );

Update a list of product to featured if product have meta value (Mysql not wpquery)

Ok I’v created a admin plugin to do this… If you have better idea 🙂 I’m in Create a admin button to open a csv file of meta_value to compare with existing products. and update products as featured if exist. add_action(‘admin_menu’, ‘featured_button_menu’); function featured_button_menu() { add_menu_page(‘Featured Products Page’, ‘Mise en avant produits’, ‘manage_options’, ‘featured-button-slug’, ‘featured_button_admin_page’); … Read more