How can I replace specific fields of an existing row in php+mysql ?
How can I replace specific fields of an existing row in php+mysql ?
Table
Field1 Field2 Field3
value1 value2 value3
I need to find the row with value1 in the table, and r开发者_运维问答eplace value3 only (leaving value2 as it is).
thanks
You could just do a simple UPDATE
statement.
UPDATE Table SET Field3 = 'NewValue' WHERE Field1 = 'value1'
the sql query is like (using UPDATE) :
UPDATE Table SET Field3 = 'mynewvalue' where Field1 = 'Value1'
to run it in php use
mysql_query or mysqli::query()
精彩评论