Support » Plugin: Surveys » No surveys found and invalid argument

  • jrhyde

    (@jrhyde)


    When I go to “manage Surveys” it says no surveys found. But my survey [SURVEYS 0] is showing on the post just fine.

    Also, on the last page where you submit a name and email, after you push submit it says “Warning: Invalid argument supplied for foreach() in C:\inetpub\wwwroot\wp-content\plugins\surveys\show_survey.php on line 24.” Line 24 looks like this: foreach($_POST[‘question_id’] as $question_id).

    Also, when I go in to look at responses, the multiple choice ones show the percentages but when I click “Individual Responses” it says “No responses Found” on that page.

    A littl ehelp anyone?

    http://wordpress.org/extend/plugins/surveys/

Viewing 3 replies - 1 through 3 (of 3 total)
  • I had the same problem and I think I resolved it with a few coding changes. I’m using
    – WordPress version 3.5.1
    – MySql 5.1.68
    – and Surveys version 1.01.8

    I found two problems.

    First, the new survey was not being saved in the database, but the questions were. That’s why the [surveys 0] worked. To fix this, I made a change in the file surveys/survey_action.php to the line that inserts a new row in the table. The field “final_screen” was not being set and MySql was complaining that there was no default value for it. The corrected line looks like:

    $wpdb->get_results(“INSERT INTO {$wpdb->prefix}surveys_survey(name,description,status,added_on,final_screen) VALUES(‘$_REQUEST[name]’,’$_REQUEST[description]’,’$_REQUEST[status]’,NOW(),”)”);

    This saved the row in the table, but it still would not display on the manage surveys screen. I found that MySql did not like the single quotes around the table name in the select statement in file surveys/survey.php

    So I removed the single quotes from around the table name. The corrected line looks like:

    $all_survey = $wpdb->get_results(“SELECT S.ID,S.name,S.added_on FROM {$wpdb->prefix}surveys_survey AS S “);

    With these two changes, I am now able to create new surveys and manage them.

    Hope this helps.

    Thanks, that helps. I still get the “Warning: Invalid argument supplied for foreach() in C:\inetpub\wwwroot\wp-content\plugins\surveys\show_survey.php on line 24” at the end though. Any ideas on that?

    Still can’t see user inputed answers either when I go to “Individual Responses.”

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘No surveys found and invalid argument’ is closed to new replies.