php - how to i take added data's id? (mysql) -
php - how to i take added data's id? (mysql) -
(my first language not english) i'm inserting new info mysql want take added data's id in same page.
for example: (im using auto increment)
$sql = "insert illustration (name) values ('$name')"; $query = mysql_query($sql,connectdb()); if ($query) { homecoming /*added info id*/; }
how do?
just phone call mysql_insert_id()
homecoming created id.
if ($query) { echo mysql_insert_id(); }
php mysql sql
Comments
Post a Comment