当前位置: 首页>>代码示例>>PHP>>正文


PHP DedeSql::GetLastID方法代码示例

本文整理汇总了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)) {
开发者ID:hensonvip,项目名称:ymroad,代码行数:31,代码来源:story_edit_photo_action.php

示例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();
?>
开发者ID:BGCX262,项目名称:zyyhong-svn-to-git,代码行数:31,代码来源:mytag_tag_guide_ok.php

示例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
开发者ID:BGCX262,项目名称:zyyhong-svn-to-git,代码行数:31,代码来源:story_add_photo_action.php

示例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:;");
开发者ID:BGCX262,项目名称:zyyhong-svn-to-git,代码行数:31,代码来源:co_add.php


注:本文中的DedeSql::GetLastID方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。