On Friday, August 24, 2007 11:50:51 PM UTC+8, Ziad wrote:
Thanks Nate, that seems to have fixed the problem! We guessed it was a
caching problem but just couldn't figure out how to turn it off.Thanks again for your quick response.
On Aug 24, 1:33 pm, nate <nate.ab...@gmail.com> wrote:
> $this->Foo->cacheQueries = false;
>
> On Aug 24, 7:53 am, Ziad <ziad.man...@googlemail.com> wrote:
>
> > Hi everyone,
>
> > I have a sequence (in postgres) that I am using to get invoice
> > numbers. This sequence is not 'attached' to any of the models, I am
> > just using it to generate numbers. However, when I call a nextval on
> > the sequence in a loop, I keep getting the same number from the
> > sequence:
>
> > foreach(...) {
>
> > $invNumberRes = null;
> > $invNumber = null;
> > $invNumberRes = $this->Fee->execute("SELECT
> > nextval('invoice_number')");
> > $invNumber = $invNumberRes[0][0]['nextval'];
>
> > }
>
> > I am getting the same value each time I am going around the loop. But
> > each time I run the script the number is being incremented by 1. Even
> > stranger, when I run a:
> > SELECT currval('invoice_number');
>
> > on the database directly its not changing after the script!
>
> > Any help with this would be greatly appreciated.
>
> > Cake version: 1.1.13.4450
> > PHP version: 5.2
> > PostgreSQL version: 8.2.4
>
> > Thanks in advance.
>
> > Ziad
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
---
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+unsubscribe@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
No comments:
Post a Comment