Using a variable name after the where clause in mysql and php -


i'm trying write php string create sql statement uses variable field name after clause. problem doesn't use variable name, i'm not php not sure if it's string concatenation or else... appreciated! i'm using php 5.5 mysql, mysqli isn't available current host.

echo $sql_subject; $sqlstring2 = "select * tablename  ". $sql_subject . " = '$set'"; 

however keeps outputting:

s select * tablename '' = '1'  

i know $sql_subject has value because it's printing above sql output... i'd say:

select * tablename s = '1' 

thanks


Comments

Popular posts from this blog

sequelize.js - Sequelize group by with association includes id -

android - Robolectric "INTERNET permission is required" -

java - Android raising EPERM (Operation not permitted) when attempting to send UDP packet after network connection -