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

java - How to compare two classes -

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

c# - Get the Class name in a class with atribute inside a attribute method -