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

Popular posts from this blog

iphone - Dismissing a UIAlertView -

intellij idea - Update external libraries with intelij and java -

javascript - send data from a new window to previous window in php -