Home > Article > Backend Development > discuz的插件是如何操作数据库的
discuz的插件是怎么操作数据库的?
add.inc.php:
<br /><?php<br />if(!defined('IN_DISCUZ')) {<br /> exit('Access Denied');<br />}<br />$q1 = $_REQUEST['q1']; <br />$addtime = time();<br /><br /> $insert_array = array(<br /> 'baankid'=>$q1,<br /> );<br /> $cone = DB::insert('pre_xyk',$insert_array);<br />?> <br />
require './source/class/class_core.php';<br />C::app()->init();<br /><br />$insert_array = array(<br /> 'classname'=>'test',<br /> 'uid'=>1,<br /> 'dateline'=>time()<br />);<br />if(DB::insert('home_class',$insert_array)){<br /> echo 'ok';<br />}/*<br />ok<br />*/<br />