Home > Backend Development > PHP Tutorial > discuz中为什么这样打不出来呢

discuz中为什么这样打不出来呢

WBOY
Release: 2016-06-13 12:06:49
Original
1150 people have browsed it

discuz中为啥这样打不出来呢

本帖最后由 z2232855560 于 2014-09-27 00:11:42 编辑 用的是DB::函数,代码如下:
<?php<br /><br />/**<br /> *      [Discuz!] (C)2001-2099 Comsenz Inc.<br /> *      This is NOT a freeware, use is subject to license terms<br /> *<br /> *      $Id: forum.php 33828 2013-08-20 02:29:32Z nemohou $<br /> */<br /><br /><br />define('APPTYPEID', 88);<br />define('CURSCRIPT', 'test');<br /><br /><br />require './source/class/class_core.php';<br /><br /><br />require './source/function/function_forum.php';<br /><br /><br /><br />C::app()->init();<br /><br /><br />$squery=DB::query("SELECT catname FROM".DB::table('portal_category'));  <br />while($value=DB::fetch($squery))<br />{<br />	$data[]=$value;<br />}<br />print_r($data);<br />?>
Copy after login

显示是下图,不知为啥提示说没有这个字段,但明明是有的啊


------解决思路----------------------
SELECT catname FROMportal_category
FROM 和 portal_category 粘在一起了
$squery=DB::query("SELECT catname FROM ".DB::table('portal_category'));  
Copy after login

------解决思路----------------------
你太粗心了,能先检查一下么...
Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template