SQL syntax error when getting data for a url

Are you sure you didn’t mean $wpdb->staff? By ommitting the $, the query now looks for a table called wpdb->staff, which isn’t valid SQL As an aside, had you considered using a custom post type/user meta instead of a custom table? Or even a custom taxonomy on users? Note as well that if you never … Read more

Update MySQL query so that it functions again

mysql_fetch_object() was deprecated in PHP 5.5 and fully removed in PHP 7.0, which is probably why it no longer works for you. It’s always better to use WP functions – often they are wrappers for something in PHP (or elsewhere), but by using the WP wrapper version, it usually protects you from deprecation (since the … Read more

WordPress member notification

PHP only runs when you request a page. When the request is over, everything is gone. It’s not like a Node application where the same program handles all the requests and variables can persist across pages just by defining them, so doing things with a $wp_session variable will only do things on that request. If … Read more

Delete Users without a First and Last Name

Replace the prefix in wp_users and wp_usermeta table names for the one you use. Make backup of data from both tables before you start to delete users. DELETE u FROM wp_users u LEFT JOIN wp_usermeta um1 ON u.id = um1.user_id AND um1.meta_key = ‘first_name’ LEFT JOIN wp_usermeta um2 ON u.id = um2.user_id AND um2.meta_key = … Read more