Organizational Research By

Surprising Reserch Topic

mysql php how to get auto increment field value before inserting data


mysql php how to get auto increment field value before inserting data  using -'php,mysql'

I'm uploading image file to storage server. Before uploading I should compose filename, which contains AUTOINCREMENT VALUE in it (for example, 12345_filename.jpg).

How could I get autoincrement value before inserting into DB?

I see only one solution


insert empty row
get it's autoincrement value
delete this row
insert row with real data using autoincrement value from p.1


Is there any other solutions?

Thank you
    

asked Oct 13, 2015 by mannumits1
0 votes
14 views



Related Hot Questions

8 Answers

0 votes
NULL
answered Oct 13, 2015 by rajeevr642
0 votes
NULL
answered Oct 13, 2015 by atulpariharmca
0 votes
NULL
answered Oct 13, 2015 by vibhorsingh
0 votes
NULL
answered Oct 13, 2015 by gauravsinghal83
0 votes
NULL
answered Oct 13, 2015 by shegokar.anjeet
0 votes
NULL
answered Oct 13, 2015 by okesh.badhiye
0 votes
NULL
answered Oct 13, 2015 by santosh soni
0 votes
NULL
answered Oct 13, 2015 by nikhilapatil

...