dedecms 的数据信息库实际操作类,***好用,在二次开发设计中特别是在关键。 引进common.inc.php文档 require_once (dirname(__FILE__) . /mon.inc.php); 获得一条纪录的內容 $row = $dsql-GetOne(Select * From `blog_arctype...
$dsql- SetQuery( Select id,typename From `blog_arctype` where reid=0 And channeltype=1 And ishidden=0 And ispart 2 order by sortrank $dsql- Execute(); while($row=$dsql- GetObject()) $channellist .= a href= wap.php?action=list id={$row- id} {$row- typename} /a echo $row- 插进一条纪录 $sql = INSERT INTO `blog_member_flink`(mid,title,url,linktype,imgurl,imgwidth,imgheight) VALUES( .$cfg_ml- M_ID. , $title , $url , $linktype , $imgurl , $imgwidth , $imgheight //插进纪录数据信息库 $dsql- ExecuteNoneQuery($sql);//实行SQL实际操作 $gid = $dsql- GetLastID();//获得不久插进的id 删掉一条纪录 $sql = Delete From blog_member_flink where aid= $aid And mid= .$cfg_ml- M_ID. $dsql- SetQuery($sql); $dsql- ExecNoneQuery(); //或是应用简单化方式 $dsql- ExecNoneQuery( Delete From blog_member_flink where aid= $aid And mid= .$cfg_ml- M_ID. 升级一条纪录 $upquery = Update blog_member_flink set title= $title ,url= $url ,linktype= $linktype , imgurl= $imgurl ,imgwidth= $imgwidth ,imgheight= $imgheight where aid= $aid And mid= .$cfg_ml- M_ID. //////////////////////////////将查寻的多个条纪录輸出////////////////////////////////// $sql = Select * from blog_* $dsql- SetQuery($sql);//将SQL查寻句子文件格式化 $dsql- Execute();//实行SQL实际操作 //根据循环系统輸出实行查寻中的結果 while($row = $dsql- GetArray()){ echo $row[ id echo $row[ title //或是采用这类方法輸出內容 while($row = $dsql- GetObject()){ echo $row- echo $row- Title; /////////////////////////////////////////////////////////////////////////////// //////////////////////////////插进一条纪录/////////////////////////////// $sql = INSERT INTO `blog_member_flink`(mid,title,url,linktype,imgurl,imgwidth,imgheight) VALUES( .$cfg_ml- M_ID. , $title , $url , $linktype , $imgurl , $imgwidth , $imgheight //插进纪录数据信息库 $dsql- SetQuery($sql);//文件格式化查寻句子 $dsql- ExecNoneQuery();//实行SQL实际操作 /////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////删掉一条纪录/////////////////////////// $sql = Delete From blog_member_flink where aid= $aid And mid= .$cfg_ml- M_ID. $dsql- SetQuery($sql); $dsql- ExecNoneQuery(); //或是应用简单化方式 $dsql- ExecNoneQuery( Delete From blog_member_flink where aid= $aid And mid= .$cfg_ml- M_ID. /////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////升级一条纪录////////////////////////// $upquery = Update blog_member_flink set title= $title ,url= $url ,linktype= $linktype , imgurl= $imgurl ,imgwidth= $imgwidth ,imgheight= $imgheight where aid= $aid And mid= .$cfg_ml- M_ID. |