Hi all:
I have a dynamically generated form which passes an array ( signup[$someVariable] ) of checkbox values (3 at present) to a script - which then processes this info on submission, placing iit into a MySQL database for later retrieval and viewing:
while(list($keys) = each($signup)) {
$insert_sql = "INSERT INTO $tableName (username,email,signedup4) VALUES ('$username','$email','$keys')";
$theQuery = mysql_query($insert_sql) or die("Died at insert into query.");
}
Odd things are happening though:
Upon submission the message "Died at insert into query." (from the above) is displayed yet, peering into my database I see that 2 of the 3 selections I made have been inserted.
My question/s are:
A: Why is PHP telling me it failed at the insert when it clearly hasn't? (well not totally!)
B: Why are only 2 pieces of information being inserted from an array of 3?
Any help would be very much appreciated:
Russ
I have a dynamically generated form which passes an array ( signup[$someVariable] ) of checkbox values (3 at present) to a script - which then processes this info on submission, placing iit into a MySQL database for later retrieval and viewing:
while(list($keys) = each($signup)) {
$insert_sql = "INSERT INTO $tableName (username,email,signedup4) VALUES ('$username','$email','$keys')";
$theQuery = mysql_query($insert_sql) or die("Died at insert into query.");
}
Odd things are happening though:
Upon submission the message "Died at insert into query." (from the above) is displayed yet, peering into my database I see that 2 of the 3 selections I made have been inserted.
My question/s are:
A: Why is PHP telling me it failed at the insert when it clearly hasn't? (well not totally!)
B: Why are only 2 pieces of information being inserted from an array of 3?
Any help would be very much appreciated:
Russ