发新话题
打印

数据库调用的问题

本主题由 admin 于 2007-11-4 12:09 移动

数据库调用的问题

以下代码只调用了一个数据库的内容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 .= "> [url=http://www.phpx.com/bbs/read.php?tid=$threads[tid]]$threads[subject][/url]
n"; } return $article; } //使用方法如: $shownew=bbs_title(60,50,100); echo "$shownew"; ?>
同时调用两个数据库的希望能修改做个列子 谢谢

TOP

发新话题