Hi,
I have one database connection
I am using an insert statement
The insert statement inserts successfully
Right after the insert I want the ID of the newest row
My database table has a unique ID and set to auto inc
mysql workbench version is 5.2.34
The value of $newid is always empty or 0
Please help!
I have one database connection
I am using an insert statement
The insert statement inserts successfully
Right after the insert I want the ID of the newest row
My database table has a unique ID and set to auto inc
mysql workbench version is 5.2.34
Code:
$save = mysqli_query($connection,"insert into table (message, title, newdate) values ('$Message', '$itle', CURDATE())");
$newid = mysql_insert_id($connection);echo('val is '. $newid);
Please help!
Comment