开发者

what is wrong with the mysql syntax in my query

开发者 https://www.devze.com 2023-02-28 15:58 出处:网络
Here is the query: $result = mysql_query( \"SELECT t.FirstName, t.LastName, g.GymName, t.City, t.State

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

精彩评论

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