简体   繁体   中英

Error from mysql query, trying to join tables

Can anyone see why this code is returning an error?

    "SELECT
a.widget_id,
c.additional_widget_id
FROM
exp_widgets AS a,
INNER JOIN exp_widget_additional AS c ON a.entry_id = c.additional_entry_id
WHERE
a.template = 3
AND
c.additional_template_id = 3
AND
(a.entry_id = 6 OR c.additional_entry_id = 6)
";

Any help appreciated.

You have a rogue comma:

...
exp_widgets AS a,
INNER JOIN exp_widget_additional`
...

should be

...
exp_widgets AS a
INNER JOIN exp_widget_additional
...

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