Is there a way that I could update several rows based on a column?
I have a table called category with 2 columns (Category, number). The column category have 2 rows(Agriculture,Apparel) which is fixed. I need a mySQL update statement that could update the number column. That means 2 rows in 'number' column will have to be updated.
The code that I gave could only update one row at the time. How do I update both rows using a single query? Thanks.
My code:
$sql="UPDATE category
SET number = '$AF'
WHERE Category = 'Agriculture' ";