Chris Dorr wrote:

> My ignorance with databases will probably show here, but I haven't been
> able to solve this myself so I thought I'd post.
> 
> I'm working on converting a DB driven site using mysql specific commands
> to the PEAR DB method.
> 
> One of the fields I have in my mysql database is a auto_increment
> primary key (will show below).
> 
> On my php script I used to use mysql_insert_id to get the id (number) of
> my last insert so I can pass this to the next page (multiple tables).
> 
> When I tried to use nextID(), it kept creating "_seq" tables in my DB
> depending on what I specified as the sequence(argument). This causes a
> problem because it returns 1, because there's nothing previously in _seq
> table.  The real _seq or auto_increment is in my table chamber(described
> below).
> 
> My question is: is there anyway to make nextID() use the
> id/auto_increment in the table I've setup previously and have id/data in
> rather than having it create _seq and rewrite all of my code??

Wild Guess:

Based on what you've said, and absolutely *NO* knowledge of PEAR DB and how 
it works, I'm guessing that nextID is designed to take in a table name, and 
return a new ID in advance for you to pass in to your INSERT statements, 
rather than the usual MySQL way of using auto_increment and getting the ID 
generated back.

There may be some other PEAR DB function to do what you wanted to do, or 
you may just be screwed and have to re-write your code...

I'd have to read the Pear docs to verify this, but I reckon you can do that 
as well as I can...

-- 
Like music?  http://l-i-e.com/artists.htm


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to