以下代码只调用了一个数据库的内容pw_threads我想调两个表的内容下面代码应该怎么写啊 function bbs_title($fid,$len,$num="10") { global $db; $query = $db->query("SELECT tid, fid, subject, authorid, postdate FROM `pw_threads` WHERE fid=$fid ORDER BY `tid` DESC LIMIT 0, $num"); while ($threads = $db->fetch_array($query)){ $threads['subject'] = substrs($threads['subject'], $len); $article .= "> <a href='bbs/read.php?tid=$threads[tid]'
target='_blank'>$threads[subject]</a><br>\n"; } return $article; }
//使用方法如: $shownew=bbs_title(60,50,100); echo "$shownew"; ?>
同时调用两个数据库的
|