Re: need help figuring out how to delete rows?
| From: | Deadsam | Date: | Mon, 25 Aug 2003 06:03:21 +0000 |
| Subject: | Re: need help figuring out how to delete rows? | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-160717@lists.php.net to get a copy of this message | ||
Cool thanks I'll try it out :)
Deadsam
"Marek Kilimajer" <kilimajer@webglobe.sk> wrote in message
news:3F473675.3000408@webglobe.sk...
> Actualy, it will not. LIMIT can have only one argument with DELETE.
> This will ($count is the number of rows you need to get in a previous
> query):
>
> DELETE FROM table ORDER BY timestamp ASC LIMIT $count-40
>
> Marek Kilimajer wrote:
>
> > DELETE FROM table ORDER BY timestamp DESC LIMIT 40, 10000000
> >
> > untested, but should work
> >
> > Deadsam wrote:
> >
> >> Hi Im making a chatroom using flash and php, the one problem Im having
is
> >> deleting rows.
> >> What I'm looking for is when they click on the button to send the
message
> >> into php-->mySql it will also
> >> check to see how many rows are in that table and if they are greater
then
> >> 40, then to delete the rows
> >> over 40, starting with the oldest ones ASC. I thought about using the
> >> chatID
> >> number but that will change
> >> everytime. So I was thinking of having it check for how many rows
> >> there is
> >> if its greater then 40 rows then
> >> delete thgose over 40 ASC.
> >> Hope I explained it good enough :)
> >> Anyhow if anyone has a solution for this I would really appreciate it.
> >> Thanks in advance
> >> Deadsam
> >>
> >>
> >>
> >>
> >
> >
>