Wpdb query with dynamic table name

I will start with the question.

From the sql error output we see this SELECT * FROM WHERE dbID = 719

This tells us that $sanitized_search_language has no value, so check it first.

Now for the BIG problem with this query!

You used get_results with a sql query that has variables as is, get_results doesn’t escape the variables.

You must use prepare when passing variables into an sql query in order to prevent sql injections.

see wpdb::get_results, the first user contribution shows a great example on how to implement this