Hi
I am collecting info from my mysql db, when running
$result = mysql_query("SELECT free from jan where free!=0");
everything is fine but when I replace the table name with a variable
$result = mysql_query('SELECT free from '$_SESSION['table']' where free!=0');
I get
Parse error: parse error, unexpected T_VARIABLE in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\Olmeto\Mysql\test.php on line 11
Line 11 is the MySQL statement line.
I have tried adding () and {} .
Is there a way I can use a variable in the statement
Many Thaks in advance.