Re: [PHP] Class ADODB - Method GenID() in MySQL

2006-07-19 Thread Chris
John Meyer wrote: Wouldn't this: $id = mysql_insert_id(); $query = "UPDATE tablename SET id=" . ($id + 1); $result = mysql_query($query); Be a little simpler. But like I said, I'm confused over the need for this in the first place, seeing as how an "auto_incremented" primary key is self-descript

RE: [PHP] Class ADODB - Method GenID() in MySQL

2006-07-19 Thread Brady Mitchell
> -Original Message- > I am using the ADODB class to connect to a MySQL server. I am trying > to generate an ID with the method GenID(), but when I tried this: > > $id = $db->GenID('table'); > > The value of $id is equal to zero. I know that MySQL doesn't use > sequences like Postgr

Re: [PHP] Class ADODB - Method GenID() in MySQL

2006-07-19 Thread Lester Caine
Renne Rocha wrote: Yes, using the PHP functions for MySQL, it works. But I am using the abstraction class ADODB to make the queries in my database. Why? Probably we will change the database system (probably to PostgreSQL) and we don want to change all the code to make the things work in the new

Re: [PHP] Class ADODB - Method GenID() in MySQL

2006-07-19 Thread Lester Caine
Renne Rocha wrote: Yes, using the PHP functions for MySQL, it works. But I am using the abstraction class ADODB to make the queries in my database. Why? Probably we will change the database system (probably to PostgreSQL) and we don want to change all the code to make the things work in the new

Re: [PHP] Class ADODB - Method GenID() in MySQL

2006-07-19 Thread Renne Rocha
Yes, using the PHP functions for MySQL, it works. But I am using the abstraction class ADODB to make the queries in my database. Why? Probably we will change the database system (probably to PostgreSQL) and we don want to change all the code to make the things work in the new BD. I don't know i

Re: [PHP] Class ADODB - Method GenID() in MySQL

2006-07-19 Thread John Meyer
Wouldn't this: $id = mysql_insert_id(); $query = "UPDATE tablename SET id=" . ($id + 1); $result = mysql_query($query); Be a little simpler. But like I said, I'm confused over the need for this in the first place, seeing as how an "auto_incremented" primary key is self-descriptive. or are you sav

Re: [PHP] Class ADODB - Method GenID() in MySQL

2006-07-19 Thread chris smith
On 7/19/06, Renne Rocha <[EMAIL PROTECTED]> wrote: Hello, I am using the ADODB class to connect to a MySQL server. I am trying to generate an ID with the method GenID(), but when I tried this: $id = $db->GenID('table'); The value of $id is equal to zero. I know that MySQL doesn't use s

Re: [PHP] Class ADODB - Method GenID() in MySQL

2006-07-19 Thread John Meyer
Renne Rocha wrote: Hello, I am using the ADODB class to connect to a MySQL server. I am trying to generate an ID with the method GenID(), but when I tried this: $id = $db->GenID('table'); The value of $id is equal to zero. I know that MySQL doesn't use sequences like PostgreSQL does (I've

[PHP] Class ADODB - Method GenID() in MySQL

2006-07-19 Thread Renne Rocha
Hello, I am using the ADODB class to connect to a MySQL server. I am trying to generate an ID with the method GenID(), but when I tried this: $id = $db->GenID('table'); The value of $id is equal to zero. I know that MySQL doesn't use sequences like PostgreSQL does (I've used this code in a