How do I find the ID of a new row added to a table?
Here's how you do it:
<?php
$q = mysql_query("INSERT INTO mytable VALUES('test')");
$rownumber = mysql_insert_id();
//$rownumber contains the id of the new row
?>
Comment on this Question and Answer >>>
ASK A QUESTION
More mysql PHP Questions
I am unable to make pages for my search result.Below I am giving the code that I am using. Career Search result Yami saysHow do I connect to mySQL from PHP?
My website www.quicheandpie.com has navigation buttons which were added by going to admin/categorylist and adding a category. I can add category = navigation buttons and update them, but I can not delete them. Any ideas how I can find where the info
How do I update the contents of a table row?
I am extracting data from a MySQL Database of which one of the data stored is seperated by a comma. For example, step1,go here,step 2,go there,step 3,go back etc etc. I want to know how to split the data at the comma and format it in html. Using the split
