How delete post_content records of specific category from phpmyadmin
How delete post_content records of specific category from phpmyadmin
How to refactor DB queries for better TTFB in WordPress?
$result = $wpdb->get_results( “SELECT `account_number`,`consumer_name`,`bill_amount`,`due_date`,`disco_date`,`bill_status` FROM {$wpdb->prefix}_bill_inquiry where `account_number` = ‘$inputnumber’ AND `pin_number` = ‘$inputpin'”, OBJECT ); $wpdb->prefix will automatically print the prefix, then to convert the result in array form you can use the following snippet: $result = json_decode(json_encode($result),true); You can either place it in a template or you can create a shortcode in … Read more
Why does DROP TABLE-ing the `wp_options` reset my user session?
The first thing you want to do will be find the post you want to modify. To find the post named “beddu” which post_type is post, you can excute this query: SELECT * FROM wp_posts WHERE post_type=”post” AND post_title=”beddu”; After you test and find the condition is correct. Move to update part. UPDATE wp_posts SET … Read more
In my opinion and from what i’ve seen on testing. Using any WordPress function will slow things down dramatically. The fastest way i found to do this is by querying MySQL directly and grabbing only the things needed. For example: $products = $wpdb->get_results( “SELECT post_title, post_name FROM `wp_posts` WHERE post_type=”products””, ARRAY_A ); echo ‘<ol>’; foreach … Read more
Reset post IDs with all post meta
I founded myself my searching: $sql = $wpdb->prepare( ” SELECT meta_value FROM {$wpdb->prefix}commentmeta INNER JOIN {$wpdb->prefix}comments ON {$wpdb->prefix}commentmeta.comment_id = {$wpdb->prefix}comments.comment_ID WHERE comment_post_ID = %d AND meta_key = ‘rating’ AND meta_value IS NOT NULL AND meta_value <> ” “, get_the_ID() ); $results = $wpdb->get_results( $sql );
wp-cli makes use of your wp-config.php credentials to connect to the db, so the fact that you are getting the install screen, and not getting any errors (I assume) when running wp-cli commands says that you seem to have it configured correctly. My only thought would be that your $table_prefix value doesn’t match the tables … Read more
Search results sort order failing: set by date only
How delete post_content records of specific category from phpmyadmin