gpt4 book ai didi

php - Opencart从3个表中检索数据

转载 作者:行者123 更新时间:2023-11-30 00:37:34 25 4
gpt4 key购买 nike

您好,我有这个疑问:

    $sql = "SELECT email_id as name,competition_rate as rate, competition.competition_id, competition.end_date 
FROM " . DB_PREFIX . "competition_winners as competition_winners,
". DB_PREFIX . "competition as competition,
". DB_PREFIX . "customer as customer

WHERE competition.competition_id = competition_winners.competition_id and customer.email=competition_winners.email_id";

我需要的是从表coster 中检索另一行名为comptition_rate 的行。我正在使用 opencart,如果将其显示在与显示为名称的客户电子邮件同一行中,那就太好了。它有可能吗?它怎么可能是圆顶?

P.s.稍微更改了代码,但我无法仅显示所有结果 racing_rate 或电子邮件。

最佳答案

  $sql = "SELECT email_id as name,customer.comptition_rate as newcomrate,competition_rate as rate, competition.competition_id, competition.end_date 
FROM " . DB_PREFIX . "competition_winners as competition_winners,
". DB_PREFIX . "competition as competition,
". DB_PREFIX . "customer as customer WHERE competition.competition_id = competition_winners.competition_id and customer.email=competition_winners.email_id";

尝试使用此查询,您将获得此 newcomrate 字段的数据

关于php - Opencart从3个表中检索数据,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22032437/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com