开发者

what is wrong with the mysql syntax in my query

Here is the query:

$result = mysql_query( "SELECT t.FirstName, t.LastName, g.GymName, t.City, t.State
                            FROM target t
                            INNER JOIN targetarea tg ON t.targetID=tg.t开发者_开发百科argetID
                            WHERE t.targetID='$id'" );  

echo $result;

Only problem is, nothing gets printed therefore i have a mysql syntax error, so what am i doing wrong?


You have g.GymName in the SELECT list but the table alias is tg not g (may be other issues as well I'm not a php-er but that one jumped out at me).

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜