简体   繁体   English

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

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

i have database that having 2 table which is event , venue. 我有2个表是活动,场地的数据库。
the event table hold eventTitle , eventID and venueID. 事件表包含eventTitle,eventID和venueID。
the venue table hold venueID , venueName and location. 场地表持有场地ID,场地名称和位置。
this is my sql query . 这是我的SQL查询。

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

but there is an error 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 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
what i want to do is display the venuename and location in the page by using php script. 我想要做的是使用PHP脚本在页面中显示venuename和位置。 after i remove 'where' clause, everything works find but the event is repeated. 删除'where'子句后,一切正常,但事件会重复。

Wrong clause where sequence 错误的子句在哪里顺序

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

In a select the where clasue is before the order by 在选择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