本文整理匯總了PHP中DedeSql::SetSql方法的典型用法代碼示例。如果您正苦於以下問題:PHP DedeSql::SetSql方法的具體用法?PHP DedeSql::SetSql怎麽用?PHP DedeSql::SetSql使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類DedeSql
的用法示例。
在下文中一共展示了DedeSql::SetSql方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: DedeSql
//保存更改
if($action=="save"){
$dsql = new DedeSql(false);
$result = "";
for($i=0;$i < $endid;$i++){
$result .= "{dede:field name=\\'".${"noteid_$i"}."\\'}".${"value_$i"}."{/dede:field}\r\n";
}
$dsql->ExecuteNoneQuery("Update #@__courl set result='$result' where aid='$aid'; ");
$dsql->Close();
ShowMsg("成功保存一條記錄!",$backurl);
exit();
}
$dsql = new DedeSql(false);
$dsql->SetSql("Select * from #@__courl where aid='$aid'");
$dsql->Execute();
$row = $dsql->GetObject();
$isdown = $row->isdown;
$nid = $row->nid;
$url = $row->url;
$dtime = $row->dtime;
$body = $row->result;
$dsql->Close();
$fields = array();
if($isdown==0)
{
$co = new DedeCollection();
$co->Init();
$co->LoadFromDB($nid);
$co->DownUrl($aid,$url);
示例2: co_copy
$dsql->ExecuteNoneQuery($inQuery);
$inQuery = "Delete From #@__co_listenurl where nid='$nid'";
$dsql->ExecuteNoneQuery($inQuery);
$dsql->Close();
ShowMsg("成功清空一個節點采集的內容!","co_main.php");
exit();
}
else
{
$dsql = new DedeSql(false);
$inQuery = "Delete From #@__courl where ";
$idsSql = "";
$ids = explode("`",$ids);
foreach($ids as $id) $idsSql .= "or aid='$id' ";
$idsSql = ereg_replace("^or ","",$idsSql);
$dsql->SetSql($inQuery.$idsSql);
$dsql->ExecuteNoneQuery();
$dsql->Close();
ShowMsg("成功刪除指定的網址內容!",$ENV_GOBACK_URL);
exit();
}
}
//複製節點
/*
function co_copy()
*/
else if($dopost=="copy")
{
CheckPurview('co_AddNote');
if(empty($notename))
{
示例3: DedeCollection
<?php
require_once(dirname(__FILE__)."/config.php");
require_once(dirname(__FILE__)."/../include/pub_collection.php");
if($nid=="")
{
ShowMsg("參數無效!","-1");
exit();
}
$co = new DedeCollection();
$co->Init();
$co->LoadFromDB($nid);
$dsql = new DedeSql(false);
$dsql->SetSql("Select count(aid) as dd From #@__courl where nid='$nid'");
$dsql->Execute();
$row = $dsql->GetObject();
$dd = $row->dd;
$dsql->Close();
if($dd==0)
{
$unum = "沒有記錄或從來沒有采集過這個節點!";
}
else
{
$unum = "共有 $dd 個曆史種子網址!<a href='javascript:SubmitNew();'>[<u>更新種子網址,並采集</u>]</a>";
}
require_once(dirname(__FILE__)."/templets/co_gather_start.htm");
$co->Close();
ClearAllLink();
?>