Hi all, this is driving me crazy...
I'm coding an online survey using PHP/MySQL and it appears that when certain users take the survey, they wind up deleting their records out of 2 of the 4 tables used in recording their data. Integrity remains with the other 2 tables.
Example: I'm USER1 and in the RESPONDENT table am set to PAGE col = PART1.php. When USER1 takes the survey, the RESPONDENT table tracks their PAGE progress so that they can leave and come back later. Now it appears that these certain individuals (it doesn't happen to everyone, nor to myself after many tests) takes the survey, and after updating their data in the SURVEY_DATA table for the particular questions on the prior page, their entire record is wiped clean. Meanwhile, thier PAGE is updated just fine in the RESPONDENT table. The code would look like this:
$SQL = "update respondent set page = '$page' where id = '$id';
$result = db_query($SQL);
$SQL = "update survey_data set (Q15,Q16,Q17) values ('$q15','$q16','$q17') where id = '$id';
$result = db_query($SQL);
At some point, the entire record of survey_data is deleted for these certain users when I am not even touching the values Q1 - Q14?! Has anyone had any problems with this?? Do the single quotes need to be double quotes?? Even so, it wouldn't explain the apparent nulling of an entire record... or would it?
Thanks a lot everyone, winner get's a cookie 😉