Re: Class ADODB - Method GenID() in MySQL
| From: | Chris | Date: | Thu, 20 Jul 2006 00:34:21 +0000 |
| Subject: | Re: Class ADODB - Method GenID() in MySQL | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-239602@lists.php.net to get a copy of this message | ||
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-descriptive. or are you saving this somewhere else in the DB?Using it elsewhere in the db as a foreign key.. ;) -- Postgresql & php tutorials http://www.designmagick.com/