Home >Backend Development >PHP Tutorial >discuz中为啥这样打不出来呢
用的是DB::函数,代码如下:
<?php/** * [Discuz!] (C)2001-2099 Comsenz Inc. * This is NOT a freeware, use is subject to license terms * * $Id: forum.php 33828 2013-08-20 02:29:32Z nemohou $ */define('APPTYPEID', 88);define('CURSCRIPT', 'test');require './source/class/class_core.php';require './source/function/function_forum.php';C::app()->init();$squery=DB::query("SELECT catname FROM".DB::table('portal_category')); while($value=DB::fetch($squery)){ $data[]=$value;}print_r($data);?>
SELECT catname FROMportal_category
FROM 和 portal_category 粘在一起了
$squery=DB::query("SELECT catname FROM ".DB::table('portal_category'));
你太粗心了,能先检查一下么...
你太粗心了,能先检查一下么...
呵呵,还是粗心的问题,其实也不是,from 后面必须要有一个空格,晕!