本文整理匯總了PHP中DedeSql::GetLastID方法的典型用法代碼示例。如果您正苦於以下問題:PHP DedeSql::GetLastID方法的具體用法?PHP DedeSql::GetLastID怎麽用?PHP DedeSql::GetLastID使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類DedeSql
的用法示例。
在下文中一共展示了DedeSql::GetLastID方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: ShowMsg
if (empty($chapterid) || !empty($addchapter) && !empty($chapternew)) {
if (empty($chapternew)) {
ShowMsg("由於你發布的內容沒選擇章節,係統拒絕發布!", "-1");
exit;
}
$dsql = new DedeSql();
$row = $dsql->GetOne("SELECT * FROM #@__story_chapter WHERE bookid='{$bookid}' ORDER BY chapnum DESC");
if (is_array($row)) {
$nchapnum = $row['chapnum'] + 1;
} else {
$nchapnum = 1;
}
$query = "INSERT INTO `#@__story_chapter`(`bookid`,`catid`,`chapnum`,`mid`,`chaptername`,`bookname`)\n VALUES ('{$bookid}', '{$catid}', '{$nchapnum}', '0', '{$chapternew}','{$bookname}');";
$rs = $dsql->ExecuteNoneQuery($query);
if ($rs) {
$chapterid = $dsql->GetLastID();
} else {
ShowMsg("增加章節失敗,請檢查原因!", "-1");
exit;
}
} else {
$dsql = new DedeSql();
}
//獲得父欄目
$nrow = $dsql->GetOne("SELECT * FROM #@__story_catalog WHERE id='{$catid}' ");
$bcatid = $nrow['pid'];
$booktype = $nrow['booktype'];
if (empty($bcatid)) {
$bcatid = 0;
}
if (empty($booktype)) {
示例2: stripslashes
$attlist .= " type='";
foreach($types as $v) $attlist .= $v.'.';
$attlist .= "'";
}
$innertext = stripslashes($innertext);
if($keyword!="") $attlist .= " keyword='$keyword'";
$fulltag = "{dede:arclist$attlist}
$innertext
{/dede:arclist}\r\n";
if($dopost=='savetag')
{
$dsql = new DedeSql(false);
$fulltag = addslashes($fulltag);
$tagname = "auto";
$inQuery = "
Insert Into #@__mytag(typeid,tagname,timeset,starttime,endtime,normbody,expbody)
Values('0','$tagname','0','0','0','$fulltag','');
";
$dsql->ExecuteNoneQuery($inQuery);
$id = $dsql->GetLastID();
$dsql->ExecuteNoneQuery("Update #@__mytag set tagname='{$tagname}_{$id}' where aid='$id'");
$dsql->Close();
$fulltag = "{dede:mytag name='{$tagname}_{$id}' ismake='yes'/}";
}
require_once(dirname(__FILE__)."/templets/mytag_tag_guide_ok.htm");
ClearAllLink();
?>
示例3: VALUES
$titlen = ${'title'.$i};
if(empty($titlen)) $titlen = ${'title'};
$inQuery = "
INSERT INTO `#@__story_content`(`title`,`bookname`,`chapterid`,`catid`,`bcatid`,`booktype`,`bookid`,`sortid`,
`memberid`,`bigpic`,`body`,`addtime`,`adminid` )
VALUES ('$titlen','$bookname', '$chapterid', '$catid','$bcatid','$booktype', '$bookid','$sortid', '0', '$bigpic' , '', '$addtime','$adminID');";
$rs = $dsql->ExecuteNoneQuery($inQuery);
//if(!$rs) echo $inQuery."<hr>\r\n";
if($rs){
$sortid++;
$postnum++;
}
}
}
$arcID = $dsql->GetLastID();
//更新圖書的內容數
$row = $dsql->GetOne("Select count(id) as dd From #@__story_content where bookid = '$bookid' ");
$dsql->ExecuteNoneQuery("Update #@__story_books set postnum='{$row['dd']}',lastpost='".time()."' where id='$bookid' ");
//更新章節的內容數
$row = $dsql->GetOne("Select count(id) as dd From #@__story_content where bookid = '$bookid' And chapterid='$chapterid' ");
$dsql->ExecuteNoneQuery("Update #@__story_chapter set postnum='{$row['dd']}' where id='$chapterid' ");
if(empty($arcID)){
ShowMsg("沒成功保存任何圖片,可能是係統有問題!","-1");
exit();
}
//生成HTML
示例4: if
}else if($ctype=='img'){
$action = "@me = TurnImageTag(@me);";
}
$exRule .= "{dede:field name='".$ctag->GetName()."' comment='".$ctag->GetAtt('itemname')."' intable='".$addtable."' source='export'}{$action}{/dede:field}\r\n";
}
}
$row['ruleset'] = $exRule;
$exRule = addslashes($exRule);
$ntime = time();
$query = "
Insert Into `#@__co_exrule`(channelid,rulename,etype,dtime,ruleset)
Values('$channelid','{$cinfos['typename']}模型','當前係統','".time()."','$exRule')
";
$dsql->ExecuteNoneQuery($query);
$gerr = $dsql->GetError();
$row['aid'] = $exrule = $dsql->GetLastID();
if($row['aid']<1){
ClearAllLink();
ShowMsg("生成規則錯誤,無法進行操作!".$gerr,"javascript:;");
exit();
}
$row['channelid'] = $channelid;
$row['rulename'] = "{$cinfos['typename']}模型";
$row['etype'] = "當前係統";
$row['dtime'] = $ntime;
}
}
if(empty($exrule)) $exrule = $row['aid'];
if(empty($exrule)){
ClearAllLink();
ShowMsg("讀取規則錯誤,無法繼續操作!","javascript:;");