php mysql get id of last insert row giving error -
I want to get the last inserted line ID and I am using the mysql_insert_id () function. But give the issue
Here is my code:
if ($ i == 0) {$ query = "Set Up Update Event e_did = '" $ multi_event. "'Where eid ='". $ Display_id. "'"; Mysqli_query ($ thor, $ query); File_put_contents ('log.txt', mysql_insert_id (), FILE_APPEND); } And {$ query = "INSERT INNOVITES (start_date, end_date, text, rick_type, event_pid, event_length, e-bid) value (''. $ Line ['start_date']. '', '". $ Row [ '', '". $ Line [' text '].' ','". $ Line ['rec_type']. "','". $ Line ['event_pid']. '', '". $ Line [' event_length ']"', '"$ multi_event"') "... Mysqli_query ($ thor, $ query); File_put_contents ('log.txt', 'a' .MISQL LIVE_ID.) 'A', FILE_APPEND); }
Now both times I am getting the same ID. What's the matter. Am I doing something wrong?
If you use mysqli functions, you should use. You can not mix ext / mysql and ext / mysqli.
In addition, the update does not generate a new Auto-Enerment ID. You should call mysqli_insert_id () after INSERT, but not updated.
Comments
Post a Comment