How do I get all the ids of the row created by one multiple row insert statement.

Posted by Curious Jo on Stack Overflow See other posts from Stack Overflow or by Curious Jo
Published on 2010-05-28T12:02:37Z Indexed on 2010/05/28 12:11 UTC
Read the original article Hit count: 242

Filed under:
|
|
|

Hi All. I'm new to php. So, please forgive me if this seems like a dumb question.

Say i have a MySQL insert statement insert into table (a,b) values (1,2),(3,4),(5,6). table 'table' has a auto increment field called 'id'.

how can I retrieve all the ids created by the insert statement above?

It will be great if i get an example that uses mysqli.

© Stack Overflow or respective owner

Related posts about php

Related posts about mysql