gpt4 book ai didi

php - 连接多个表中的数据

转载 作者:行者123 更新时间:2023-11-30 01:15:34 24 4
gpt4 key购买 nike

我从来没有使用过这样的 PHP/MYSQL 技巧来连接多表。请有这方面经验的人帮忙:

$qry=mysql_query("select {$table_prefix}user_cv.*, {$table_prefix}advertising.* from {$table_prefix}user_cv, {$table_prefix}advertising where {$table_prefix}user_cv.publish='yes' and {$table_prefix}advertising.publish='Y'");

mysql查询返回0结果。

最佳答案

$qry = "SELECT {$table_prefix}user_cv.*, {$table_prefix}advertising.*
FROM {$table_prefix}user_cv
LEFT JOIN {$table_prefix}advertising ON {$table_prefix}advertising.publish='Y'
WHERE {$table_prefix}user_cv.publish='yes'";
mysql_query($qry);

我没有测试过这个!我可能是错的,但这可能是朝着正确方向迈出的一步。 (还是新的自己)

关于php - 连接多个表中的数据,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19087028/

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