tags:

views:

115

answers:

3

I am getting this error

PHP Parse error:  syntax error, unexpected T_VARIABLE, expecting ')' in /Applications/MAMP/htdocs/widget_corp/includes/functions.php

from the following code

function get_all_subjects($public = true)
{
    global $connection;

    $query = "SELECT * 
                FROM subjects
                ORDER  BY position ASC";

    $subject_set = mysql_query($query, $connection);
    confirm_query ($subject_set);
    return $subject_set;
}

$subject_set = mysql_query($query, $connection); is the affected line

Any help

+4  A: 

$confirm_query should be confirm_query without the $.

Jimmie Lin
Am still getting the same error
Gatura
+1  A: 

As you've been told, the syntax error is not in the part of the code you are pasting. It looks like you forgot a closing parenthesis somewhere (or you have an extra opening one).

Álvaro G. Vicario
A: 

The error message tells you there is an unexpected T_VARIABLE token, when the Parser expected a closing parenthesis (although it could also be a missing semicolon or other symbol). The unexpected T_VARIABLE in your case is $subject_set. The syntax error must be somewhere before this.

Gordon