NYCPHP Meetup

NYPHP.org

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

Jim Hendricks jim at bizcomputinginc.com
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
______________________________________________________________
Jim Hendricks, President, Biz Computing, Inc
Phone:  (201) 599-9380     Email: jim at bizcomputinginc.com
Web: www.bizcomputinginc.com
Snail:  Jim Hendricks,  Biz Computing, Inc.,  255 McKinley Ave, New Milford,
NJ 07646
______________________________________________________________

----- Original Message -----
From: "Nasir Zubair" <lists at ny-tech.net>
To: "NYPHP Talk" <talk at nyphp.org>
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
accesses
> to an online helpdesk, 24 for example.
>
> I'm having trouble coming up with a query to select/delete the oldest
entry
> 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 http://nyphp.org/list/ ---
>
>
>
>




More information about the talk mailing list