Re: [PHP] need help figuring out how to delete rows?
Cool thanks I'll try it out :) Deadsam Marek Kilimajer [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] 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, 1000 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 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] need help figuring out how to delete rows?
DELETE FROM table ORDER BY timestamp DESC LIMIT 40, 1000 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 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] need help figuring out how to delete rows?
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, 1000 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 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] need help figuring out how to delete rows?
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 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php