开发者

PHP Syntax error related to brackets, when all brackets are closed [closed]

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center. Closed 9 years ago.

I keep geting this error: Parse error: syntax error, unexpected '}' in /Users/skline/Sites/tiptap/Site/tiptap/survey_current.php on line 67

However, all my brackets are closed! I am really confused, thanks in advance..

<?php

    $dbc = mysql_connect(DATABASE_HOSTNAME,DATABASE_USERNAME, DATABASE_PASSWORD);
    if(!$dbc){
        die('Not connected' .mysql_error());
    }
    // Select database
    $db_selected = mysql_select_db(DATABASE_DATABASENAME, $dbc);
    // If fails, exit and cry
    if (!$db_selected) 
    {
        die ("can't connect : " .mysql_error());
    }

    function getCurrentSurvey($consumer_id){
        $last_survey_sql="SELECT DISTINCT ssr.SET_ID AS SET_ID,
                      ssr.SURVEY_ID AS SURVEY_ID
                      FROM branching_survey_responses AS bsr
                      JOIN survey_set_relation AS ssr
                      ON bsr.SET_ID=ssr.SET_ID
                      AND bsr.SET_ID=(SELECT Max(set_id)
                                    FROM branching_survey_responses
                                    WHERE CUSTOMER_ID=$consumer_id)
                      AND bsr.CUSTOMER_ID=$consumer_id;";

        $last_survey_result=mysql_query($last_survey_sql); 

        $last_set= mysql_result($last_survey_result,0,"SET_ID");

        $last_survey= mysql_result($last_survey_result,1,"SURVEY_ID");

        $last_question_sql="SELECT DISTINCT QUESTION_ID
                        FROM branching_survey_responses
                        WHERE QUESTION_ID=(SELECT Max(QUESTION_ID)
                                          FROM branching_survey_responses
                                          WHERE C开发者_如何学GoUSTOMER_ID=$consumer_id
                                          AND SET_ID=$last_set)
                        AND CUSTOMER_ID=$consumer_id
                        AND SET_ID=$last_set;";

        $last_question_result=mysql_query($last_question_sql); 

        $last_question=mysql_result($last_question_result, 0, "QUESTION_ID");

        $survey_count_sql= "SELECT COUNT(*) AS survey_count
                        FROM surveytable;";

        $survey_count_result=mysql_query($survey_count_sql); 

        $survey_count=mysql_result($suvery_count_result, 0, "survey_count");

        $question_count_sql="SELECT Max(q.QUESTION_ID) AS question_count
                        FROM questions as q
                        JOIN branching_table as bt
                        ON bt.question_id=q.question_id
                        JOIN survey_set_relation as ssr
                        ON ssr.SET_ID=bt.SET_ID
                        AND ssr.SURVEY_ID=$last_survey;";

        $question_count_result=mysql_query($question_count_sql); 

        $question_count=mysql_result($question_count_result, 0, "question_count");

        $current_survey = array("last_survey"=>$last_survey, "last_question"=>$last_question, "survey_count"=>$survey_count, "last_survey"=>$question_count);

        return $current_survey

    }
    $test=getCurrentSurvey(217);

    echo $test['last_survey'];
    echo $test['last_question'];
    echo $test['survey_count'];
    echo $test['question_count'];

    ?>


    return $current_survey

Missing semicolon on this line.


return $current_survey -> missing ";"?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜