Sunday 23 December 2018

php - How to get the ID as the record is inserted?

I am inserting record into database using the insert query as



INSERT INTO task_record(assigned_by,handle_by) VALUES('$assigned_by', '$handle_by')



adding this record assign a unique ID to the each record i want to get that ID as soon as the record is inserted.
Is there any simple way to modify the query or i have to use one more query of select which is not a fine option

No comments:

Post a Comment

php - file_get_contents shows unexpected output while reading a file

I want to output an inline jpg image as a base64 encoded string, however when I do this : $contents = file_get_contents($filename); print &q...