Hi,

You should use LAST_INSERT_ID() function, check the manual for details:
http://www.mysql.com/doc/en/Getting_unique_ID.html

Regards

Joseph Bueno

Poizot Emmanuel wrote:
> Hi,
> I'm writing a c++ program using MySQL++.
> I insert in a table a new line. This table has an autoincrement field call ID.
> Immediatly after storing a new line in the table, I execute (in the program) a 
> SELECT * FROM table command to retrieve the new ID just affected to the new 
> line, but I always got 0 for it.
> What's wrong ? Should I put a commit command i the code ?
> Thanks



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

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to