(My First language is not English)
i’m inserting new data to mysql but i want to take added data’s id in same page.
for example: (im using auto increment)
$sql = "INSERT INTO example (name) VALUES ('$name')";
$query = mysql_query($sql,connectDB());
if ($query)
{
return /*added data id*/;
}
How i do?
Just call
mysql_insert_id()to return the most recently created id.