View Single Post
  #3 (permalink)  
Old November 30th, 2006, 07:40 AM
talk2leo talk2leo is offline
Authorized User
 
Join Date: Nov 2006
Location: Bhopal, MP, India.
Posts: 31
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to talk2leo
Default

Hi You can also do it like the query below..this will
remove the problem of id if it is AUTO_INCREMENT
$id = mysql_insert_id();
$sql="insert into Users(ID,Usrname,PSW) values('$id','User','P@sw')";
$sql1="insert into Details(ID,firsn,Last_n) values('$id','Test','Users')";

by doing so it will remobve the overhead of how to keep same id in both the tables..because if user is submitting information then you will not assign him/her id each time.

Reply With Quote