I have an application that updates two MySQL database tables. One table has an
auto_increment id field. I need to use this id to link to an entry in the other
table. Is there an easy way to find out what the auto_incremented number is so I can
use it to update the other table?
Robbert van
Hi Robbert,
Is there an easy way to find out what the auto_incremented
number is so I can use it to update the other table?
Sure, have a look at mysql_insert_id:
http://php.net/mysql_insert_id
Cheers
Jon
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit:
: RE: [PHP] mysql auto increment question
Hi Robbert,
Is there an easy way to find out what the auto_incremented
number is so I can use it to update the other table?
Sure, have a look at mysql_insert_id:
http://php.net/mysql_insert_id
Cheers
Jon
--
PHP General Mailing List (http://www.php.net
does mysql auto_increment always has to be 1 by 1, can't I set it to go 10
by 10, or something like that?
and is there a way I can tell him to START (the first record) with a number
or do I have to put a bogus record or even alter it's value so the next
insertion is incremented from that...
I am working with php-mysql
and am inserting into mysql using a NULL value,
which allows mysql to auto-insert (increment)
a number - how could I find out what the value was
mysql inserted, say on the next line of code after the insert?
--
PHP General Mailing List (http://www.php.net/)
To
5 matches
Mail list logo