Hello, I am executing the insert query in mysql database through php script, But i am unable to get the last insert id . I had used the syntax mysql_insert_id(); anybody knows whats the problem and whats the solution? thanks raj
Hi rajnikant.. May be your placement is being wrong....... It will return last inserted id from database, so please use it just after a insert query execution...like this $sql="insert into ............"; mysql_query($sql); $getid=mysql_insert_id(); echo $getid; I think .............you got you solution...