Click to See Complete Forum and Search --> : Updating timestamp only


Beach Bum
11-03-2005, 09:32 AM
I have a row where I want to just update the auto timestamp. There is an element in the row with timestamp as the type.

I thought I could just update another element to itself using this:
$query = mysql_query("UPDATE $table_users SET ip = '$ip' WHERE ip = '$ip' ")

But apparently mysql is smarter than that and does not do the update. I know I could always just add a bogus element to update, but does anyone know a trick to get mysql to just update the timestamp.

Beach Bum
11-03-2005, 10:26 AM
never mind - found the answer

$query = mysql_query("UPDATE $table_users SET timestamp = now() WHERE ip = '$ip' ")