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 set $wpdb->staff
, it won’t exist, so you’d be better using the table prefix combined with a hardcoded table name
Related Posts:
- Column count doesn’t match value count at row 1
- Access denied for user ‘root@localhost’ (using password:NO)
- MySQL error 2006: mysql server has gone away
- Which MySQL data type to use for storing boolean values
- ERROR 2003 (HY000): Can’t connect to MySQL server on localhost (10061)
- “INSERT IGNORE” vs “INSERT … ON DUPLICATE KEY UPDATE”
- PHP Connection failed: SQLSTATE[HY000] [2002] Connection refused
- #1273 – Unknown collation: ‘utf8mb4_unicode_520_ci’
- Your password does not satisfy the current policy requirements
- MySQL: Access denied for user ‘test’@’localhost’ (using password: YES) except root user
- What is the definition of cardinality in SQL
- How to restart remote MySQL server running on Ubuntu linux?
- what does “/index.php?admin/admin_dashboard” in my url mean
- How to join two tables by multiple columns in SQL?
- How to get size of mysql database?
- Selecting data from two different tables without using joins
- SQL – Update multiple records in one query
- Difference between VARCHAR and TEXT in MySQL
- MySQL Error 1093 – Can’t specify target table for update in FROM clause
- mysqladmin: connect to server at ‘localhost’ failed
- mysql update multiple columns with same now()
- Usage of MySQL’s “IF EXISTS”
- Simple Random Samples from a Sql database
- What does SQL clause “GROUP BY 1” mean?
- Generating a random & unique 8 character string using MySQL
- MySQL > Table doesn’t exist. But it does (or it should)
- SQL select only rows with max value on a column
- Trying to perform MINUS operation in MySQL
- Getting java.sql.SQLException: Operation not allowed after ResultSet closed
- phpmyadmin #1045 Cannot log in to the MySQL server. after installing mysql command line client
- MySQL config file location – redhat linux server
- How to create a foreign key in phpmyadmin
- Can’t create test file lower test start server mysql
- MySQL delete multiple rows in one query conditions unique to each row
- Create boolean column in MySQL with false as default value?
- SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo failed: Name or service not known
- Is there a naming convention for MySQL?
- CAST to DECIMAL in MySQL
- Is merge statement available in MySQL
- GROUP_CONCAT comma separator – MySQL
- Failed to Connect to MySQL at localhost:3306 with user root
- How do you properly prepare a %LIKE% SQL statement?
- Set page template for all pages?
- SQL query to update post_date (one post = one single date & time)
- My WordPress site always displays a cached version of its homepage
- How to copy post titles to post slug in phpmyadmin
- If I consider changing my WordPress DB tables to InnoDB, will it have an effect on the way WordPress works?
- Proper way to work with wpdb to get user’s firstname
- How to change post format from Aside to Image for all posts?
- Inserting Hundreds of Thousands of Posts at Once
- wp_admin edit.php slow with lots of queries
- Database: Custom table: sprintf value for DateTime column
- can database and media folder be moved to a different drive?
- What is the most secure way to set up the MySQL user in WPMU?
- Find duplicate posts with same slug and author
- WP_USE_EXT_MYSQL
- Distinction on meta value on pre_get_posts
- How to get data from WordPress site sql file
- WordPress with php5-fpm and nginx
- MySQL Rank & $wpdb
- When WordPress Default table, Echo Success. When Plugin Table, Echo Blank
- WordPress post_status is future, manually added
- How are multiple WordPress WPDB queries handled?
- $wpdb to insert html form information
- Proper usage of $wpdb->update()?
- Regarding “Insert query error” in wordpress
- MySQL 5.5 upgrade ‘broke’ WordPress [closed]
- WordPress plugin overloading with tmp tables
- Site not responding error – taking long to load [closed]
- What should a WordPress developer know about MySQL? [closed]
- Copyright: Get first and last date of post type
- WordPress(wpdb class) and mysql stored procedures
- WordPress plugins for database queries
- Query posts by custom taxonomy and sort by post_modified
- WordPress $wpdb get posts from category and sort by custom meta
- WordPress tables and aliases?
- What’s the sql for this condition?
- Copy usermeta value where ID matches in the same table
- Array Formation Issue
- Migration problems with mysql: Operation not allowed when innodb_forced_recovery > 0 [closed]
- WordPress $wpdb no result
- (WP List Table) How to sort by SKU and Custom Fields?
- User set date and time from frontend doesn’t get stored into database
- when using $wpdb sudden connection rejection without changing anything. Access denied, with errors from repair tool
- How to run SQL query from WordPress ‘WP Crontrol’ plugin
- How to bulk delete a certain part of all wordpress posts
- edit_user_created_user hook – using to update Groups
- Mysql Error in querying form entries in Gravity Form plugin
- update_option returns false in AJAX, how to debug?
- Improving performance of SQL sub-queries in WordPress
- Saving custom term value to the database in new table
- MySQL errors after a WordPress clone
- MYSQL Join on meta key value?
- Complicated MySQL Query
- problem with quotes on new post
- Where other than wp-config can database access details be defined?
- Why does the MySQL command line tool ignore the –port parameter?
- Postgres equivalent to MySQL’s \G?
- Changing host permissions for MySQL users
- Possible SQL injection. How to locate and fix?