Sorted it out. DONT USE QUERY! Rather use execute if you can.

On May 7, 1:18 pm, Unite <[EMAIL PROTECTED]> wrote:
> Have now tried using
>
> $this->User->cacheQueries = false;
>
> Doesnt work :(
>
> On May 7, 1:09 pm, Unite <[EMAIL PROTECTED]> wrote:
>
> > Whats not cakephp except the INSERT INTO. Yes i would use save but i
> > was trying everything to see if i can get it to work. And most of it
> > isnt the actual code just something i made up so i can illustrate the
> > problem.
>
> > How do you stop cake caching the queries?
>
> > On May 7, 1:05 pm, "Marcin Domanski" <[EMAIL PROTECTED]> wrote:
>
> > > >  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 Domanskihttp://kabturek.info
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to