Wpdb empty result only if language is Russian
I’ve solved the problem. As I was boiling my head to find another approach, I’ve seen that stato_ru column was the only one not having utf8_generic_ci encoding…
I’ve solved the problem. As I was boiling my head to find another approach, I’ve seen that stato_ru column was the only one not having utf8_generic_ci encoding…
There are at least two ways you can accomplish this: 1. Easy way: simply create two nav menus, one for logged in users, and one for logged out users. Then wherever your theme uses wp_nav_menu() you would simply wrap that output in a conditional to check whether the user is logged in/out and output the … Read more
I found an answer. Essentially I had an infinite loop that was quite puzzling at first. It made more sense as I saw that it never iterated beyond the first item in the post array. I found the answer here: https://tommcfarlin.com/update-post-in-save-post-action/ The issue is that wp_update_post hooks into save_post… so every time I would reach … Read more
wpdb->update update the entire table instead of one row
Oh dear, that was extremely obvious – there was a missing closing bracket! Here is the working query. SELECT ID, ( 6371 * acos ( cos ( radians( 35.665833 ) ) * cos( radians( latitude.meta_value ) ) * cos( radians( longitude.meta_value ) – radians( 139.731111 ) ) + sin ( radians(35.665833 ) ) * sin( … Read more
Display result from custom post meta query
I found the solution by logging into the site FTP, renaming my WP site’s index.php to index.php_, and supplying this code in a new index.php file: <!DOCTYPE html> <html> <body> <?php $servername = “xxx.xxx.xxx.xxx”; $username = “xxxxx”; $password = “xxxxx”; try { $conn = new PDO(“mysql:host=$servername;dbname=xxxxxx”, $username, $password); // set the PDO error mode to … Read more
You have several things going on there and I may not be able to sort them all out. Unless $wpdb->cf7dbplugin_submits has been added to the $wpdb object your query won’t work. You will need something like {$wpdb->prefix}cf7dbplugin_submits instead but I can’t really guess at the right value. You don’t need to swap in 9999. That … Read more
Private Messages between users
There isn’t an error. The square brackets are empty– aka “no error”. Put a spurious comma in the SQL and you will see what I mean. But your SQL is wildly complicated for you are doing. That is entirely equivalent to SELECT * FROM $table ORDER BY id DESC LIMIT 1 Though, I notice you … Read more