/    Sign up×
Community /Pin to ProfileBookmark

Retrieving last updated row from MYSQL (not last inserted)

Hi

I have a database of links. Sometimes these links break, I want to make a list of recently fixed links. Either in the past 24 hours, or just the last 5 or so.

Is this possible, and how?

thanks

to post a comment
PHP

3 Comments(s)

Copy linkTweet thisAlerts:
@NogDogJul 26.2008 — It's possible if you include a timestamp or datetime column in the table that you set to the current time when you update it. (If you use a timestamp type, you can define it to automatically update on any update of its row.)
Copy linkTweet thisAlerts:
@spliffauthorJul 27.2008 — hi, thanks. and how do you do that?
Copy linkTweet thisAlerts:
@NogDogJul 27.2008 — <i>
</i>ALTER TABLE table_name
ADD COLUMN last_update TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
×

Success!

Help @spliff spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.17,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...