> foreach($file_list as $file) {
> //read file contents
> //search to see if record exists
> $user_id = $this->User->query("SELECT id FROM users WHERE
> emailaddress = '[EMAIL PROTECTED]'");
> //if record does not exist write record to db
> $this->User->query("INSERT INTO users (emailaddress) VALUES
> ('[EMAIL PROTECTED]')");
> //get last record inserted
> $temp = $this->User->query("SELECT last_insert_id()");
> }
Are you kidding ? this is not even close to cakephp i would be ashamed
to show such code on this group.
> On the first loop everything works 100%.
> On the second loop even though the email address has been inserted and
> is in the DB (supposedly) $user_id still returns empty as if nothing
> is there. I put in the sleep command to see if maybe php is running
> faster than the database is updating but this has no effect. What can
> I do to make sure that all query processes have been completed before
> it starts the next loop?
maybe cake is caching the queries ?
--
Marcin Domanski
http://kabturek.info
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---