Updating a Row without Updating anything ? (Timestamp)

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
asterinex
Forum Commoner
Posts: 52
Joined: Thu Nov 25, 2004 7:01 am
Location: Belgium

Updating a Row without Updating anything ? (Timestamp)

Post by asterinex »

Hello,

I have a Table with online Users . Containing only 2 fields, a username and a timestamp.

Is it possible to Update a record without actually updating anything, because there are no fields to update. The timstamp field will reset to current time wenn updatet


UPDATE usersonline WHERE username = $username ; ?

Thanks in advance!
kettle_drum
DevNet Resident
Posts: 1150
Joined: Sun Jul 20, 2003 9:25 pm
Location: West Yorkshire, England

Post by kettle_drum »

Code: Select all

UPDATE usersonline SET time = NOW() WHERE username = '$username'
Post Reply