SupeSite利用join left联合查询出新闻表中带有图片附件记录
这里在supesite表中一个主表,supe_spaceitems与supe_attachments附件表,我们通过left jon查找 出有图片附件的记录出来。
代码如下 | 复制代码 |
mysql教程_connect('localhost','root','root'); $sql = "select a.itemid,a.lastpost,a.city,b.thumbpath from supe_spaceitems a left join supe_attachments b on a.itemid = b.itemid where a.picid>0 order by a.itemid desc limit 0,3"; |
echo $str;
永久链接:http://www.phprm.com/code/34146.html
转载随意!带上文章地址吧。