Jump to content

Archived

This topic is now archived and is closed to further replies.

master82

Simple mass update

Recommended Posts

I have the field '[b]daysold[/b]' in my [b]users[/b] table.

How would I go about updating this by 1 each time I run the script for all the entries in the users table? (the script will become a cron I will run at midnight each day)

I have tried in the past but it updated all the entries (users) with the same number, rather than each entry! lol

Any help would be kindly recieved :)

Share this post


Link to post
Share on other sites
UPDATE users SET daysold = daysold + 1

Share this post


Link to post
Share on other sites
But wont that update all the users entries to the same number.

eg

user 1 - 1 day old
user 2 - 2 days old
user 3 - 6 days old

will become

user 1 - 2days old
user 2 - 2 days old
user 3 - 2 days old

I could be wrong though... Ill give it a try

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.