Re: [PHP] Too many DELETE statements

2004-12-02 Thread Richard Lynch
Lordo wrote: > Thanks guys. I delete 500 by 500 now and it takes like 20 seconds only. I > am > using the manual select where in method. It is great. > > Now for the files, OK I will use a cron. But can I change the way I get > the > file names? I mean instead of deleting the photo that is related

Re: [PHP] Too many DELETE statements

2004-12-02 Thread Richard Lynch
David Dickson wrote: > Richard Lynch wrote: >> Plus you are unlink-ing 10 files. That's probably the real problem. >> >> You'd have to write some timing code to be sure, though, as a slow >> database server and a very fast hard drive could be involved. >> >> Here are some things you could do to sp

Re: [PHP] Too many DELETE statements

2004-12-02 Thread Lordo
Thanks guys. I delete 500 by 500 now and it takes like 20 seconds only. I am using the manual select where in method. It is great. Now for the files, OK I will use a cron. But can I change the way I get the file names? I mean instead of deleting the photo that is related to a deleted member, can I

Re: [PHP] Too many DELETE statements

2004-12-02 Thread Lordo
Thanks. I will check the foreign key with cascading issue. But I have a question: Will it have any bad effects on behavior? I have tables with 160,000, 400,000, etc. records. Lordo "David Dickson" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > news.php.net wrote: > > A member is no

Re: [PHP] Too many DELETE statements

2004-12-02 Thread David Dickson
Richard Lynch wrote: Plus you are unlink-ing 10 files. That's probably the real problem. You'd have to write some timing code to be sure, though, as a slow database server and a very fast hard drive could be involved. Here are some things you could do to speed it up, assuming you don't want the ON

Re: [PHP] Too many DELETE statements

2004-12-02 Thread Lordo
Thanks alot. You really gave me some good ideas. Lordo "Richard Lynch" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > news.php.net wrote: > > I have 160,000+ members in my site. 40,000 of them have not logged in > > since > > 2003 and they should be deleted. A member is not delete

Re: [PHP] Too many DELETE statements

2004-12-02 Thread Richard Lynch
David Dickson wrote: > news.php.net wrote: >> A member is not deleted from only one >> table. Based on user id, he should be deleted from 5 tables and also his >> photo, if any, should be unlink(ed). >> >> $query = "delete from table1 where userid = " . $ID; >> $result = mysql_query($query, $link);

Re: [PHP] Too many DELETE statements

2004-12-02 Thread Richard Lynch
news.php.net wrote: > I have 160,000+ members in my site. 40,000 of them have not logged in > since > 2003 and they should be deleted. A member is not deleted from only one > table. Based on user id, he should be deleted from 5 tables and also his > photo, if any, should be unlink(ed). > > I tried

Re: [PHP] Too many DELETE statements

2004-12-02 Thread David Dickson
news.php.net wrote: A member is not deleted from only one table. Based on user id, he should be deleted from 5 tables and also his photo, if any, should be unlink(ed). $query = "delete from table1 where userid = " . $ID; $result = mysql_query($query, $link); $query = "delete from table2 where useri

[PHP] Too many DELETE statements

2004-12-02 Thread news.php.net
I have 160,000+ members in my site. 40,000 of them have not logged in since 2003 and they should be deleted. A member is not deleted from only one table. Based on user id, he should be deleted from 5 tables and also his photo, if any, should be unlink(ed). I tried to do that 10 by 10 using: $quer