亚洲国产成人,色呦呦内射午夜,无码一级片,无码人妻少妇色欲AV一区二区

<samp id="jg8hh"></samp>

<p id="jg8hh"></p><delect id="jg8hh"><em id="jg8hh"><blockquote id="jg8hh"></blockquote></em></delect><acronym id="jg8hh"><dd id="jg8hh"></dd></acronym><button id="jg8hh"><dd id="jg8hh"><acronym id="jg8hh"></acronym></dd></button><samp id="jg8hh"><em id="jg8hh"><blockquote id="jg8hh"></blockquote></em></samp>

<p id="jg8hh"></p>

<samp id="jg8hh"><legend id="jg8hh"></legend></samp>
<samp id="jg8hh"><legend id="jg8hh"><samp id="jg8hh"></samp></legend></samp>

<samp id="jg8hh"></samp>

<p id="jg8hh"></p><acronym id="jg8hh"></acronym><p id="jg8hh"><dd id="jg8hh"><acronym id="jg8hh"></acronym></dd></p><p id="jg8hh"></p>

<p id="jg8hh"></p><delect id="jg8hh"><legend id="jg8hh"><var id="jg8hh"></var></legend></delect><button id="jg8hh"><listing id="jg8hh"><i id="jg8hh"></i></listing></button>
<delect id="jg8hh"><legend id="jg8hh"><var id="jg8hh"></var></legend></delect>

dede數(shù)據(jù)庫(kù)的常用的操作方法有哪些

發(fā)布時(shí)間:2024-04-24
dedecms操作數(shù)據(jù)庫(kù)的各類(lèi)方法,二次開(kāi)發(fā)都會(huì)用到的。
首先,引入common.inc.php文件
require_once (dirname(__file__) . \”/include/common.inc.php\”);
1、獲取一條記錄的內(nèi)容:
$row = $dsql->getone(\”select * from dede_* where id = $aid\”); echo $row[\’id\’];
2、將查詢(xún)獲取總數(shù)輸出:
$row = $dsql->getone(\”select count(*) as dd where typeid = $typeid\”); echo $row[\’dd\’];//輸出總數(shù)
3、將查詢(xún)的若干條記錄輸出
$sql = \”select * from dede_*\”; $dsql->setquery($sql);//將sql查詢(xún)語(yǔ)句格式化 $dsql->execute();//執(zhí)行sql操作 //通過(guò)循環(huán)輸出執(zhí)行查詢(xún)中的結(jié)果 while($row = $dsql->getarray()){ echo $row[\’id\’]; echo $row[\’title\’]; } //或者采取這種方式輸出內(nèi)容 while($row = $dsql->getobject()){ echo $row->id; echo $row->title; }
4、將查詢(xún)的若干條記錄輸出
$dsql->setquery(\”select id,typename from `dede_arctype` where reid=0 and channeltype=1 and ishidden=0 and ispart<>2 order by sortrank\”); $dsql->execute(); while($row=$dsql->getobject()) { $channellist .= \”{$row->typename} \”; echo $row->id; }
5、插入一條記錄
$sql = \” insert into `dede_member_flink`(mid,title,url,linktype,imgurl,imgwidth,imgheight) values(\”.$cfg_ml->m_id.\”,\’$title\’,\’$url\’,\’$linktype\’,\’$imgurl\’,\’$imgwidth\’,\’$imgheight\’);\”;//插入記錄數(shù)據(jù)庫(kù) $dsql->executenonequery($sql);//執(zhí)行sql操作 $gid = $dsql->getlastid();//獲取剛剛插入的id
6、刪除一條記錄
$sql = \”delete from dede_member_flink where aid=\’$aid\’ and mid=\’\”.$cfg_ml->m_id.\”\’;\”; $dsql->setquery($sql); $dsql->execnonequery(); //或者使用簡(jiǎn)化模式 $dsql->execnonequery(\”delete from dede_member_flink where aid=\’$aid\’ and mid=\’\”.$cfg_ml->m_id.\”\’;\”);
7、更新一條記錄
$upquery = \” update dede_member_flink set title=\’$title\’,url=\’$url\’,linktype=\’$linktype\’, imgurl=\’$imgurl\’,imgwidth=\’$imgwidth\’,imgheight=\’$imgheight\’ where aid=\’$aid\’ and mid=\’\”.$cfg_ml->m_id.\”\’; \”; $rs = $dsql->executenonequery($upquery);
8、判斷獲取數(shù)據(jù)庫(kù)內(nèi)容的常用方法
$row = $dsql->getone(\”select * from dede_moneycard_type where tid={$pid}\”); if(!is_array($row)){ echo \”失敗\”; exit(); } $upquery = \” update dede_member_flink set title=\’$title\’,url=\’$url\’,linktype=\’$linktype\’, imgurl=\’$imgurl\’,imgwidth=\’$imgwidth\’,imgheight=\’$imgheight\’ where aid=\’$aid\’ and mid=\’\”.$cfg_ml->m_id.\”\’; \”; $rs = $dsql->executenonequery($upquery); if($rs){ echo \”成功\”; }else{ echo \”失敗\”; }
9、獲取總數(shù)
$dsql = new dedesql(false); $dsql->setquery(\”select * from `dede_admin` where userid=\’$userid\’ or uname=\’$uname\’\”); $dsql->execute(); $ns = $dsql->gettotalrow(); 關(guān)閉數(shù)據(jù)庫(kù) $dsql->close();
轉(zhuǎn)載:非常歡迎各位朋友分享到個(gè)人站長(zhǎng)或者朋友圈,但轉(zhuǎn)載請(qǐng)說(shuō)明文章出處“黎青松seo博客”。
原文地址:http://www.alitaohuo.com/cmsjiaocheng/zhimengjiaocheng/1916.html

上一個(gè):電纜故障測(cè)試儀的應(yīng)用原理
下一個(gè):甲烷減排劍指垃圾填埋廠,或?qū)⒓铀俜贌娲厔?shì)

Q671F氣動(dòng)意大利式超薄型球閥特點(diǎn)以及執(zhí)行機(jī)構(gòu)優(yōu)點(diǎn)
涵洞怎么接長(zhǎng)?
電動(dòng)鍋爐管道用煙氣蝶閥結(jié)構(gòu)
新茶雖好并非人人適合
中藥發(fā)展離不開(kāi)氣流微粉碎機(jī)的強(qiáng)勁動(dòng)力
zuk z2怎么調(diào)震動(dòng)強(qiáng)度,怎樣調(diào)振動(dòng)盤(pán)振動(dòng)強(qiáng)度
草花的施肥
怎么鑒別帶式壓濾機(jī)報(bào)廢的程度
客戶(hù)訂購(gòu)噴霧干燥器前必須與廠家溝通的問(wèn)題
日處理5噸商業(yè)綜合體餐廚垃圾處理整套設(shè)備企業(yè)