Forum Moderators: open

Message Too Old, No Replies

200 000 queries - do not execute all of them

queries problem

         

heatdesign

4:45 pm on Oct 7, 2009 (gmt 0)

10+ Year Member



I have this problem with sending 200 000 times the query "SELECT * FROM emails WHERE title = '".$el."'" to check if the email already exist in the DB. It looks like this : foreach ($emails as $el) {
$query = "SELECT * FROM emails WHERE title = '".$el."'";
here goes the check...
}
but if i put a counter in "foreach" without the $query, it goes through all elemenets, unfortunately if I send a query every time it can't reach the end of the cycle... with 100 000 emails there is no problem... what am i doing wrong?