Page 1 of 1

I want to replace some fields of a row in my table and leave

Posted: Thu Sep 01, 2011 2:07 am
by aneuryzma
I want to replace some fields of a row in my table and leave other fields intact.

$res = mysql_query("REPLACE INTO User VALUES('updatedValue',...,...,'updatedValue2', 'updatedValue3'')");

The values with '...' should not be replaced. What code should I write ?
thanks

Re: I want to replace some fields of a row in my table and l

Posted: Thu Sep 01, 2011 2:44 am
by genix2011
Hi,

you have to use the MySQL Update command.

Example:

Code: Select all

mysql_query("Update `User` SET `field1` = 'updatedValue1', `field2` = 'updatedValue2' WHERE `ID`=2");
Greets.