In my current plugin, I am picking up the
order by column as user input. So I thought of using
wpdb->prepare to escape it.
$wpdb->get_results($wpdb->prepare("Select id from $wpdb->posts order by %s %s", $order_by_col, $order_by);
This is not working because it gets turned into
select id from wp_posts order by 'post_date' 'asc'
(Note the quotes)
So is there way to remove the quotes? Also is this a proper way to use $wpdb->prepare()? Should I manually escape it myself?