开发者

MySQL Query gives error: unexpected T_CONSTANT_ENCAPSED_STRING [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 ap开发者_如何学Pythonplicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center. Closed 9 years ago.

I know this error is usually a problem with unclosed quotes and such, but I can't seem to find the problem here. I suspect it's something to do with the parentheses, who knows though.

The error:

Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING 

The query:

$result = @mysql_query('select * from quotes inner join game on game.id=quotes.game_id inner join person on person.id=quotes.speaker_id where game.id = ' . $gameid . ' and person.id in (SELECT person.id
    FROM person
    JOIN coach ON person.id = coach.person_id
    JOIN team  ON coach.team_id = team.id where team.id=' . $name '

    Union

    SELECT person.id
    FROM person
    JOIN player ON person.id = player.person_id
    JOIN team  ON player.team_id = team.id where team.id=' . $name . ')');


You write:

' ... JOIN team  ON coach.team_id = team.id where team.id=' . $name ' ...

Where it should be:

' ... JOIN team  ON coach.team_id = team.id where team.id=' . $name . ' ...

(note the dot right behind $name)

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜