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


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" 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
-~----------~----~----~----~------~----~------~--~---

Reply via email to