NYCPHP Meetup

[nycphp-talk] Re: semaphores on Windows

Ophir Prusak ophir at prusak.com
Tue Mar 11 11:30:24 EST 2003


1. on selects, get the latest 10 from the database on selects (just in case)

2. and after an insert, find the 10th latest entry
3. delete all entries older then what u found in step 2

that's of course just one way of doing it.

----- Original Message -----
From: "Emmanuel. M. Decarie" <emm at scriptdigital.com>
To: "NYPHP Talk" <talk at nyphp.org>
Sent: Tuesday, March 11, 2003 11:08 AM
Subject: Re: [nycphp-talk] Re: semaphores on Windows


> Hello Ophir, thanks for the reply.
>
> Its really basic stuff. A Flash file will send via POST to a PHP
> script some text. I need to insert the text in MySQL in a row which
> have an auto_increment column. I want to keep only the last 10 text,
> so I will query MySQL to get all the text, and if I have more than 10
> texts, I will delete the older ones.
>
> Cheers
> -Emmanuel
>
> À (At) 09:53 -0500 11/03/03, Ophir Prusak écrivait (wrote) :
> >Can you describe the situation in a bit more detail ?
> >As you said - you probably don't need semaphores, but what is it exactly
> >that you're trying to do ...
> >
> >----- Original Message -----
> >From: "Emmanuel. M. Decarie" <emm at scriptdigital.com>
> >To: "NYPHP Talk" <talk at nyphp.org>
> >Sent: Tuesday, March 11, 2003 9:27 AM
> >Subject: [nycphp-talk] Re: semaphores on Windows
> >
> >
> >>
> >>  I forgot to add  that I need semaphores for INSERT and DELETE sql
> >>  statement for MySQL. Maybe this is not needed after all. The rows
> >>  that are concerned are using a column with an AUTO_INCREMENT
> >>  attribute.
> >>
> >>  I don't need rollback (i.e. transaction). In its book on MySQL, Paul
> >>  Dubois write: "MySQL automatically performs locking for single SQL
> >>  statements to keep clients from interfering with each other." (Paul
> >  > Dubois, MySQL, New Riders, 2000).
>
>
> --
> ______________________________________________________________________
> Emmanuel Décarie / Programmation pour le Web - Programming for the Web
> Radio UserLand/Frontier - Perl - PHP - Javascript
<http://scriptdigital.com/>
> Blog: <http://blog.scriptdigital.com> - AIM: scriptdigital
>
>
>
> --- Unsubscribe at http://nyphp.org/list/ ---
>
>
>





More information about the talk mailing list