繁体   English   中英

如何在不同数据库表的一个页面中显示数据

[英]how to display data in one page from different database table

我有2个表是活动,场地的数据库。
事件表包含eventTitle,eventID和venueID。
场地表持有场地ID,场地名称和位置。
这是我的SQL查询。

$sqlEvent = "SELECT * FROM te_events , te_venue ORDER by eventTitle
                WHERE te_events.venueID = te_venue.venueID
                 ";

但是有u have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'WHERE te_events.venueID = te_venue.venueID' at line 2 u have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'WHERE te_events.venueID = te_venue.venueID' at line 2
我想要做的是使用PHP脚本在页面中显示venuename和位置。 删除'where'子句后,一切正常,但事件会重复。

错误的子句在哪里顺序

"SELECT * FROM te_events , te_venue 
  WHERE te_events.venueID = te_venue.venueID
ORDER by eventTitle  ";

在选择where clasue在order by之前

$sqlEvent = "SELECT * FROM te_events , te_venue WHERE te_events.venueID = te_venue.venueID ORDER by eventTitle  ";

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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