> I am inserting several fields into a table, however there's an 'id' (id integer not 
>null auto_increment) column that I use as the primary key.
>
> the problem lies in the fact that I want to get the 'id' that was generated from 
>this insertion. However the data I insert has no unique value apart from the 'id' 
>field itself how should I go about retrieving the id number ?

Have a look at http://www.mysql.com/doc/G/e/Getting_unique_ID.html and
look for LAST_INSERT_ID() in
http://www.mysql.com/doc/M/i/Miscellaneous_functions.html , that should
take care of what you're wanting to do.

And hard wrap is your friend :)

Tim Wilde

-- 
Tim Wilde
[EMAIL PROTECTED]
Systems Administrator
Dynamic DNS Network Services
http://www.dyndns.org/


---------------------------------------------------------------------
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