Question

Question

Post by Edward Suro » Sun, 08 Jul 2001 16:52:05



Hi

You should use the following construction:

SELECT LAST_INSERT_ID ();

This will return the last auto-increment value for the current connection.
There is also an API function, and in PHP: mysql_insert_id or something like
this.

-----Original Message-----

Sent: Friday, July 06, 2001 8:43 PM
To: MySQL
Subject: Question

i have designed a system that works on MSSQL but i have decided to port it
over to mysql.  One of the problems i have come across is i need to figure
out how to get the autoid back.  so just say i insert a record, and MYSQL
gives it the auto id of 6, how do i know that from my VB program?

Jason

---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)



Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

 
 
 

1. SET query question (was ENUM query question)

Yes!  My apologies; didn't have my coffee this morning.  The column is of
type SET.

Jeff

---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)



Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

2. POV Modeler Needed!!

3. Optimizer Question & LOAD DATA Question.

4. Sceptre Flat Screen monitors

5. Newbie Question: MySQLDump Questions [FileMaker related]

6. C++

7. string->array question. ( 2 query questions)

8. compiling rtw generated c code on DSP C40

9. Optimizer Question & LOAD DATA Question.

10. Install question and an ERROR 1064 question

11. ?? Questions Database Security & Form Results questions including Security?

12. Sourcesafe corruptions; deleting from database; questions

13. newbie question about databases and CW