简体   繁体   中英

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.targetID
                            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?

您在SELECT列表中有g.GymName ,但是表别名不是tg而不是g (也可能是其他问题,我不是php -er,但那个跳了我)。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM