php - what is the right way to include a variable in an sql statement -


i want include variable in sql statement it's not outputting data. how include variable correctly?

$vstyles = $wpdb->get_results( 'select slug vf_venuestyles vid = "$vid"');

change quote marks around: $vstyles = $wpdb->get_results("select slug vf_venuestyles vid = '$vid'");

but, unless function / class magic that, should using proper prepared statements.


Comments

Popular posts from this blog

android - InAppBilling registering BroadcastReceiver in AndroidManifest -

python Tkinter Capturing keyboard events save as one single string -

sql server - Why does Linq-to-SQL add unnecessary COUNT()? -