including variable in a mysql select statement [Solved]
Posted: Mon Apr 23, 2007 11:17 pm
Hi guys, im working a php script with mysql, im trying to use a select statement using a variable, here's the example,
$var="test";
$result=mysql_query("SELECT * FROM table WHERE $var='1'");
;im always getting an error on this part with the variable, but if replace the variable with its corresponding value, the script works. Hope you can help me on this. Thanks in advance.
$var="test";
$result=mysql_query("SELECT * FROM table WHERE $var='1'");
;im always getting an error on this part with the variable, but if replace the variable with its corresponding value, the script works. Hope you can help me on this. Thanks in advance.