Re: MySQL question...not sure if this is the correct forum to ask.

From: Date: Thu, 14 Feb 2002 22:36:16 +0000
Subject: Re: MySQL question...not sure if this is the correct forum to ask.
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-84838@lists.php.net to get a copy of this message
Peter, > I have a quick MySQL question...if this is not the correct forum for > it, then someone please point me to the right one. > > Can the UPDATE statement have conditional check embedded in it? I > have a page that displays a record (in a FORM format) that the user can > change the information on each column. I want to check each column and > see which has been changed and update the table for entries that were > changed only. > > for each column data { > if column is changed > then update; > else > do nothing; > } > > Maybe I am making this too complicated than it needs and just go ahead > and update all of the columns regardless with the new values, regardless > they are actually different or not. There is a MySQL list, and a separate PHP-DB list. UPDATE is 'intelligent', it will only modify the row if there is something to change. Regards, =db

« previous php.general (#84838) next »