I am trying to fetch a field value(SecurityQues) on basis of user input(username).
Following is the code:
$substr=substr($usrnm,0,2);
if($substr=="AC")
{
$res="SELECT SecurityQues FROM reg_ac WHERE UserName=$usrnm";
}
else
{
$res="SELECT SecurityQues FROM reg_indi WHERE UserName=$usrnm";
}
$result = mysql_query($res,$db_handle);
$result = mysql_query($res);
while($row = mysql_fetch_assoc($result))
{
echo $row['SecurityQues'];
}
But i am getting the following warning:
Warning: mysql_fetch_assoc() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\my on line 120