Consider there is the following table.



Now I want to query only the rows whose value is 1.

I use the following code

Code: 

$sql="SELCET  name, reg, branch, year from i11 where sf='1'";
$result=mysql_query($sql);
while ($row=mysql_fetch_array($result))
but I got the following warning

Code: 
Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in \xampp\htdocs\reg\events.php on line 19


Kindly give information about the correct query.

Thank you.
GoPantheoN Reviewed by GoPantheoN on . MySql Query Consider there is the following table. http://lulzimg.com/i14/384165.jpg Now I want to query only the rows whose value is 1. I use the following code Rating: 5