Wednesday, 11 September 2013

add search criteria PHP/MySQL

add search criteria PHP/MySQL

I have some code which display's products from a MySQL database. The
products shown match a search the user has entered.
Here is my code:
$result=mysql_query("SELECT * FROM products WHERE catagory =
'$catagory' ")
In the database i also have a column called active, How do i only show
reults that match the search criteria (catagory) and have a 1 in the the
active box?
Thanks in advance.

No comments:

Post a Comment