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

python Tkinter Capturing keyboard events save as one single string -

android - InAppBilling registering BroadcastReceiver in AndroidManifest -

javascript - Z-index in d3.js -