Please help me with how can I retrieve data from mysql having a variable in my sql query.. my php code is
$status=$_GET['status'];
$query="SELECT * FROM students WHERE status='$status' ";
When I run the query mysql generates
unknown column 'Lead'
where Lead is the value of $status. I tried it with \'$status\' , '{$status}' but same error.. Please help me I'm working on it since yesterday but found no solution. I tried mysql_real_escape_string() but same error.. may be I was using it with wrong syntax.
$query="SELECT * FROM students WHERE status=".mysql_real_escape_string($status);
Thanks in advance....