I am making a database request in wordpress to make this question: select * from tc_chat_clt;
How ever a error appears, what am I doing wrong?
$users = $wpdb->get_results($wpdb->prepare('SELECT * FROM %s',`tc_chat_clt`));
I am making a database request in wordpress to make this question: select * from tc_chat_clt;
How ever a error appears, what am I doing wrong?
$users = $wpdb->get_results($wpdb->prepare('SELECT * FROM %s',`tc_chat_clt`));
Share
Improve this question
asked Dec 13, 2020 at 1:51
tiago caladotiago calado
6324 silver badges17 bronze badges
1 Answer
Reset to default 1PHP views backticks (ie, ``) as delimiting something that should be executed, not as a quotation character. Use single quotes ('
) instead.
$users = $wpdb->get_results($wpdb->prepare('SELECT * FROM %s', 'tc_chat_clt'));