本文整理汇总了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();
?>