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

android - Basic camera in app -

javascript - Why Selenium can't find an element that is graphically visible -

scala - Using the kronecker product on complex matrices with scalaNLP breeze -