我从来没有做过这样的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);


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

08-25 12:45