我从来没有使用过这样的 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/