mysql - How to set a variable in where clause of Select query in php -


while executing below query i'm not getting sucess value

$name=qwe; $result = mysql_query("select *from user name = $name"); 

instead of above query if put below, can able appropriate ans:

$result = mysql_query("select *from user name = 'qwe'"); 

can give solution first query??

close variable in quote , concatenate string query

$name= "qwe"; $result = mysql_query("select *from user name = '".$name."'"); 

one more note please use mysqli security purposes. thanks


Comments

Popular posts from this blog

javascript - Any ideas when Firefox is likely to implement lengthAdjust and textLength? -

matlab - "Contour not rendered for non-finite ZData" -

delphi - Indy UDP Read Contents of Adata -