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
> -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
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
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
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
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
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
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
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
9 matches
Mail list logo