mysql_insert_id() is a very usefull function..
what does it do ?
it returns id generated from previous insert query.
Could you give some example ?
mysql_query("insert into product (name) values(aflower)");
if you want to print id of "aflower" you can use mysql_insert_id
echo mysql_insert_id();
if you want to print id of "aflower" you can use mysql_insert_id
echo mysql_insert_id();
!: to use mysql_insert_id your cloumn should be an auto_increment cloumn
Related posts
Tags: functions, mysql, mysql_insert_id, Php

No comments
Comments feed for this article
Trackback link: http://www.alonon.net/mysql_insert_id/trackback/