Thanks KarveR,
I was a little suspicious of that newid variable being inserted into the table...so I fixed that. So what my code looks like now:
$SQL = "INSERT INTO document (title) VALUES ('$title')";
$newid= mysql_insert_id();
mysql_query($SQL);
printf...
Hi,
Relatively new to the PHP/MySQL world, hoping you can help. I have built a database and I am having trouble grasping one little part. I need to get the id that is a primary key, auto increment, in one table (document) and put it into another table(key_doc_join) as the data is being entered...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.