All databse queries are executed synchronously - i.e. once you call
`find()`, the next line of code will not execute until the find has
been completed, the data fetched and formatted.

If the returned data is not there, then there must be a problem with
your query. Using the sql query log (debug=2), check the sql and
results. Execute exactly the same sql directly in your database (mysql
console, phpminiadmin, phpPgAdmin, ...) and ensure that the results
are correct.

hth
grigri

On Jan 16, 10:45 am, forrestgump <vikhya...@gmail.com> wrote:
> Was wondering if there is a delay function i could use in my
> controller , to force cake to wait for a find() function to execute...
> This is the situation iam in....
>
>  $temp=$this->Invno->find('all',array('conditions'=>''.
> $conditions,'fields'=>array('id')));
>  $this->data['invno_id']=0;
> $this->data['invno_id']=$temp[0]['Invno']['id'];
>
> Now i wish to execute this statement only after $this->data
> ['invno_id'] had been set
> $this->Invoice->save($this->data)
>
> but for some reason there is an observed delay and the program just
> halts....
>
> i did this to check if there is a delay--
> $temp=$this->Invno->find('all',array('conditions'=>''.
> $conditions,'fields'=>array('id')));
>  $this->data['invno_id']=0;
> $this->data['invno_id']=$temp[0]['Invno']['id'];
>
> if($this->data['invno_id']!=0)
> {
>  $this->Invoice->save($this->data);}
>
> else
> {
>  $this->Session->setFlash('There is a delay in getting the invno_id');
>  $this->redirect('/invoices',null,true);
>
> }
>
> I keep getting the message "There is a delay in getting the invno_id".
> Can someone help me with a workaround?
>
> Will appreciate any help...
>
> forrestgump
--~--~---------~--~----~------------~-------~--~----~
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 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to