Does anybody out there with php & mysql experience know how to retrieve the unique id key that is created when a new entry (new row) is inserted into a table? I have limited php experience... I usually have to copy and paste code to things to work for me!!!
I was looking thru the process.php code, and here is the code that puts the new entry (new row) into the database:
The ID field is unique, and is automatically generated and auto-incremented everytime a new row is inserted into the table. Is there a way for this query function to also return the unique ID key that is generated in mytable? This will be a handy way to give the person who submitted the form a "Ticket#" that is unique to them.
Thanks
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
This only remains unique if nothing is ever deleted. You are better off creating a unique ID of your own. In any case the phpFormgenerator admin retreives the ID number from the SQL db. If you have the generator, create a form with SQL and have a look at the data retrieved with the admin. You will see that on or about line 273 the data extractions starts at column 1. Change this to start at 0 and the ID field can be displayed.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Does anybody out there with php & mysql experience know how to retrieve the unique id key that is created when a new entry (new row) is inserted into a table? I have limited php experience... I usually have to copy and paste code to things to work for me!!!
I was looking thru the process.php code, and here is the code that puts the new entry (new row) into the database:
$link = mysql_connect("localhost","myusername","mypassword");
mysql_select_db("mydatabase",$link);
$query="insert into mytable (info1,info2) values ('".$info1."','".$info2."')";
mysql_query($query);
The ID field is unique, and is automatically generated and auto-incremented everytime a new row is inserted into the table. Is there a way for this query function to also return the unique ID key that is generated in mytable? This will be a handy way to give the person who submitted the form a "Ticket#" that is unique to them.
Thanks
This only remains unique if nothing is ever deleted. You are better off creating a unique ID of your own. In any case the phpFormgenerator admin retreives the ID number from the SQL db. If you have the generator, create a form with SQL and have a look at the data retrieved with the admin. You will see that on or about line 273 the data extractions starts at column 1. Change this to start at 0 and the ID field can be displayed.