Re: LAST_INSERT_ID & LAST_UPDATE_ID
| From: | Lester Caine | Date: | Fri, 25 May 2007 08:09:31 +0000 |
| Subject: | Re: LAST_INSERT_ID & LAST_UPDATE_ID | ||
| References: | 1 | Groups: | php.windows |
| Request: | Send a blank email to php-windows+get-27969@lists.php.net to get a copy of this message | ||
sam rumaizan wrote:
What I want to do is: 1-user has 10 columns (fields). 2- User updated one of these fields using CONCAT_WS(adding new data to previous data). 3- When user views any of his information he sees only the last updated part of the data.Not sure what you are trying to do here. Once you have updated the record UPDATE table SET column = CONCAT_WS ('column,'" . $column."') WHERE column= value; Then the record 'column= value' will be updated. SELECT * FROM table WHERE column=VALUE will return that record - except you seem to be changing the 'key' by which you reference the record? So you probably need SELECT * FROM table WHERE column = CONCAT_WS ('column,'" . $column."') to get that record. The NORMAL method of working would be UPDATE table SET column = CONCAT_WS ('column,'" . $column."') WHERE KEY_COLUMN = value; Then SELECT * FROM table WHERE KEY_COLUMN = value; will return the whole record that was updated. If you want to see the changes, then you would need to do this before and after the update and compare the fields. -- Lester Caine - G8HFL ----------------------------- Contact - http://home.lsces.co.uk/lsces/wiki/?page=contact L.S.Caine Electronic Services - http://home.lsces.co.uk MEDW - http://home.lsces.co.uk/ModelEngineersDigitalWorkshop/ Firebird Foundation Inc. - http://www.firebirdsql.org/index.php