Home  >  Article  >  Backend Development  >  dz3.1论坛增添一句代码 网页空白了

dz3.1论坛增添一句代码 网页空白了

WBOY
WBOYOriginal
2016-06-13 11:59:36964browse

dz3.1论坛添加一句代码 网页空白了

本帖最后由 seqq001 于 2014-06-12 13:13:00 编辑 source\module\forum\forum_forumdisplay.php添加
$query = $db->query("select * from bbs_forum_post where tid ='$tid' ");<br />while($result = $db->fetch_array($query)) {<br />      $mythread[] = $result;<br />}

forumdisplay_list.htm模板文件下添加

      {$val[message]}
       

网站页面空白了,是怎么回事

------解决方案--------------------
1、打开查看错误日志
2、打印相关变量看看,在哪一行出现错误
目测 $db不存在吧,dx3以后不支持这种写法了
------解决方案--------------------
discuz有自己的数据库类 封装了很多方法 也包含安全过滤

$query = $db->query("select * from bbs_forum_post where tid ='$tid' ");
while($result = $db->fetch_array($query)) {
      $mythread[] = $result;
}

你这段 改成

$tid = intval($tid);
$mythread = DB::fetch_all('select * from '.DB::table('forum_post').' where tid = $tid');
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn