Hi!
I'm having a strange problem with my MySQL database for an online survey I'm developing. Basically, I'm using the following code:
$id_variable="";
mysql_query("INSERT INTO cladding (s_type) VALUES (1)");
if(mysql_errno()) die(mysql_error());
$id_variable=mysql_insert_id();
to insert a new record into a table, and then passing the variable $id_variable to further pages, so that I can load up previously saved data, etc...
this is all working fine, BUT when I try and run the page on more than one computer (over the internet), the second computer seems to inherit the first computer's id number. Surely when the value (in this case "s_type=1" each time) is inserted into the database "cladding", a new field is created, and hence a new id number.
Is there a way to solve this??? The only way at present it seems is to tell the user to press the "refresh" button. This seems to solve it, but I've no idea why, and I'd prefer to avoid going down that route if possible!
any help most appreciated
tony
I'm having a strange problem with my MySQL database for an online survey I'm developing. Basically, I'm using the following code:
$id_variable="";
mysql_query("INSERT INTO cladding (s_type) VALUES (1)");
if(mysql_errno()) die(mysql_error());
$id_variable=mysql_insert_id();
to insert a new record into a table, and then passing the variable $id_variable to further pages, so that I can load up previously saved data, etc...
this is all working fine, BUT when I try and run the page on more than one computer (over the internet), the second computer seems to inherit the first computer's id number. Surely when the value (in this case "s_type=1" each time) is inserted into the database "cladding", a new field is created, and hence a new id number.
Is there a way to solve this??? The only way at present it seems is to tell the user to press the "refresh" button. This seems to solve it, but I've no idea why, and I'd prefer to avoid going down that route if possible!
any help most appreciated
tony