I am beginning to study php and my sql.
I don’t know what is wrong with this code.
$result = mysql_query("SELECT * FROM tbl where field1 (1,2,3)");
I am getting this error.
Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in test.php on line 52
When I replace that particular line with this
$result = mysql_query("SELECT * FROM tbl");
It works fine but it returns all rows.
I am trying to filter the rows display using where command in mysql.
What is the proper syntax for that?
Thanks
You need an
INclause:This query is analogous to:
Also, please keep in mind
mysql_queryhas been deprecated and its use is discouraged.