[nycphp-talk] selecting/deleting all oldest entries in mysql.

Jim Hendricks jim at
Tue Mar 11 08:17:46 EST 2003

You could use a seq# for each person.  When inserting the record do a select
on max seq# to obtain the highest # used for that individual, increment that
#, insert the new record, then delete where seq# <= newnumber - x and person
= logged in person.

Jim Hendricks, President, Biz Computing, Inc
Phone:  (201) 599-9380     Email: jim at
Snail:  Jim Hendricks,  Biz Computing, Inc.,  255 McKinley Ave, New Milford,
NJ 07646

----- Original Message -----
From: "Nasir Zubair" <lists at>
To: "NYPHP Talk" <talk at>
Sent: Monday, March 10, 2003 8:41 PM
Subject: [nycphp-talk] selecting/deleting all oldest entries in mysql.

> Hi all,
> I need to create a small logger, for our work place, that will log staff's
> IP addresses and host names. What I'm trying to do is to log last X
> to an online helpdesk, 24 for example.
> I'm having trouble coming up with a query to select/delete the oldest
> when a X+1st entry,  (25th for the above number), is inserted.
> Can anyone hint me on how to go about doing it?
> - Nasir
> --- Unsubscribe at ---

More information about the talk mailing list