Hi I am creating an hotel reservation site for a friend.I found a nice tutorial on html.it and the code runs fine from the command line, no problem. Now I need to build an interface say to insert clients's data. So I have a form.My problem is that for the site to work I need to save last_insert_id to a variable called @codCliente.Can somebody just write for me that line of code so that I can insert it in the php file that handles the form? Please don't send me to some url looking for the answer, I've tried them all. Thank you.
P.S:If you need the whole code please let me know.
Jump to Post
mysql_query('INSERT QUERY HERE'); $codCliente = mysql_insert_id();
Here's the link to the manual: http://php.net/manual/en/function.mysql-insert-id.php
All 5 Replies
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.