SELECT t.*,a.* FROM cdb_threads t INNER JOIN cdb_attachments a ON t.tid=a.tid WHERE t.attachment=1 group by t.tid ORDER BY t.dateline DESC
(注意:把cdb_改成论坛数据表的前缀,默认为cdb_)
2、调用论坛指定版块多图帖子中的其中一张图片
SELECT t.*,a.* FROM cdb_threads t INNER JOIN cdb_attachments a ON t.tid=a.tid WHERE t.fid in (2,3) and t.attachment=1 group by t.tid ORDER BY t.dateline DESC
(注意:把cdb_改成论坛数据表的前缀,默认为cdb_ ,fid in (2,3) 2,3为指定的版块ID)