Tool to check the database in Production [closed]

You can try use: MySQL WorkBench or other MySQL Client program; SSH to the Server and connect from the command prompt; Use PHPMyAdmin (make sure to password protect and set the right configuration); If you are really in need of an extra level of security you may want to consider setting up a VPN between … Read more

Best db table structure for users with many records

Personaly I would go with one table for all users. Having more tables with the same columns seems like a strange idea to me. The database will be a complete mess after you gwt more users. Make sure that the user_id is an index for the table and all your select/update/delete will be fine. The … Read more

How to delete field using WPDB?

You can’t “delete” a field in MySQL, this only works for complete rows. However, you can unset values, meaning setting them to their original state, usually NULL or an empty string. $wpdb->update($wpdb->posts, array( ‘product_rank’ => NULL ), array( ‘ID’ => $post_id ));

How do I use update_option to give me a new option name each time a form is submitted? [duplicate]

To update a new option name each time you need something unique to be used as option name so may be using ‘time’ in the option name $now = new DateTime(); $mytime = $now->format(‘Y-m-d H:i:s’); // MySQL datetime format // $now->getTimestamp(); // Unix Timestamp $option[‘prefix-‘.$mytime] = ‘your value’; Then you can update as you wish. … Read more

single.php not pulling in any data from database

have_posts() needs a WordPress database query before it will show anything, check it here like this: $the_query = new WP_Query( ‘post_type=post’ ); if ( $the_query->have_posts() ) { echo ‘<ul>’; while ( $the_query->have_posts() ) { $the_query->the_post(); echo ‘<li>’ . get_the_title() . ‘</li>’; } echo ‘</ul>’; } else { // no posts found } it will display … Read more