如题 我想把版块名,帖子标题,还有作者全部给调用出来,现在作者和标题好解决,因为他们在一个表里面,但是版块名在另外一个表里面,请问,sql同时调用两个表怎么操作,谢谢了 [e:loop={"select author,tid,fid,subject from cdb_threads ,name from cdb_forums where digest<>0 order by tid desc limit 10",10,24,0}] <tr> <td><?=$bqr[name]?></td> <td><a href="/bbs/viewthread.php?tid=<?=$bqr[tid]?>" target="_blank"><?=$bqr[subject]?></a></td> <td><?=$bqr[author]?></td> </tr> [/e:loop] 因为name是另外一个表里面,所以sql语句有错误,希望哪位大侠能帮忙改一下!感谢sooden 版主 以下是正确的sql语句: [e:loop={"select cdb_forums.name,cdb_threads.subject,cdb_threads.author,cdb_threads.dateline from cdb_threads,cdb_forums where cdb_forums.fid=cdb_threads.fid and cdb_threads.digest<>0 order by cdb_threads.tid desc limit 10",10,24,0 }] <tr> <td><?=$bqr[name]?></td> <td><a href="/bbs/viewthread.php?tid=<?=$bqr[tid]?>" target="_blank"><?=$bqr[subject]?></a></td> <td><?=$bqr[author]?></td> </tr> [/e:loop]
上传以下图片:
|