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

java - How to pass parameters between Request-Scoped Controllers? -

actionscript 3 - Flex: moving a point with rotation doesnt change the point XY? -

string - what is the difference between "some" == "some\0" and strcmp("some","some\0") in c++? -