Re: LAST_INSERT_ID & LAST_UPDATE_ID

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Database Programming]     [PHP Install]     [Kernel Newbies]     [Yosemite Forum]     [PHP Books]

  Powered by Linux