I need to put data in a MySQL db, but I also need to get the id assigned to the insert. Is there a SQL statement that allows me to insert values and select the index of that insert in a single query?
Thanks
SELECT id FROM table1 WHERE id IN (insert into table1 (name,phone) values ($name,$phone));
how about use microtime() as id, it will be unique enough