php - what is the right way to include a variable in an sql statement -
this question has answer here:
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
Post a Comment