Link to home
Start Free TrialLog in
Avatar of Solutionabc
Solutionabc

asked on

mysql Update a row with WHERE condition

MySQL

How do I update all the columns in a row using the WHERE clause? the WHERE is equal to a php variable.

thanks.
Avatar of Member_2_6009151
Member_2_6009151
Flag of United Kingdom of Great Britain and Northern Ireland image

The UPDATE statement is used in the following way...

UPDATE mytable SET myfield = 'newvalue' WHERE myotherfield = 'a value'

... if you need to update all rows, simply miss off from WHERE onwards.

... hope this helps...
ASKER CERTIFIED SOLUTION
Avatar of sammySeltzer
sammySeltzer
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial