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 set $wpdb->staff, it won’t exist, so you’d be better using the table prefix combined with a hardcoded table name