Forum Moderators: open
Anyway, the survey has been up for about a week (after 4 days of testing) and the client is just now reporting issues.
I'm trying to test without skewing the survey results so I created a duplicate database, and duplicated the files and pointed to the duplicate database for testing.
Now when I try to submit the test version of the survey, I get the following error:
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/user/public_html/subdomain/web_servicestest.php on line 91
Here's lines 85-110 of that file:
function wsInsertAnswers($department_id, $level_id, $answer_array)
{
$survey_id = wsGenerateGUID();
$sql = "INSERT INTO surveys (survey_id, department_id, level_id)
SELECT '" . $survey_id . "', '" . $department_id . "', '" . $level_id . "'";
if (mysql_query($sql))
{
// insert survey details
for ($i = 0; $i < count($answer_array); $i++)
{
$survey_detail_id = wsGenerateGUID();
$sql = "INSERT INTO survey_details (survey_detail_id, survey_id, question_id, " . $answer_array[$i][1] . ")
VALUES ('" . $survey_detail_id . "', '" . $survey_id . "', " . $answer_array[$i][0] . ", " . $answer_array[$i][2] . " )";
if (!mysql_query($sql))
{
wsRollbackInsertAnswers($survey_id);
return false;
}
}
return true;
}
else
{
return false;
}
}
Can anyone tell me how to correct this error?
Thanks in advance!
Sari