I only do a SELECT on a whole table – and the table is defined in a variable:
$table = $wpdb->prefix . 'members';
Do I have to bind a parameter to this variable?
This caused an error:
$result = $wpdb->get_results($wpdb->prepare("SELECT * FROM %s", $table, ARRAY_A));
But if I skip the “%s”, this gives an error as well:
$result = $wpdb->get_results($wpdb->prepare("SELECT * FROM $table", ARRAY_A));
Should I skip “prepare” in this case?