Lots of queries!
| From: | Philip Thompson | Date: | Tue, 25 Jul 2006 19:39:36 +0000 |
| Subject: | Lots of queries! | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-239776@lists.php.net to get a copy of this message | ||
Hi all.
I have a list of people in a database who live in particular rooms. Next semester, they may live somewhere else, so I need to update my database. (I know the data becomes stale, but not that often.) Here's what I'm doing to update:
1. Pull list of IDs from database A - store in array
2. Foreach ID in array, search database B to see if they have a new room
2a. If no, go back to step 2 and go to next ID
3. Compare new room to current room
3a. If different, update the record to new room
That's basically it. Now, I know this works (sorta) because the records are updating with the appropriate information. Here's the problem I'm running into: it only does a certain amount and then quits!! WHY!!?!
The total number of records I have is 1335 - pulled from step 1. However, when I go through the list and query for new rooms, it stops... randomly... not even at the same record each time. Sometime it's 230, sometimes it's 476 - truly random from what I can tell. I am sorting the query (ORDER BY) each time, so I know it's the same order.
Any thoughts on why this is happening? Possibly a buffer issue?
Thanks in advance.
~Philip