本文整理汇总了PHP中mysqlquery::lastid方法的典型用法代码示例。如果您正苦于以下问题:PHP mysqlquery::lastid方法的具体用法?PHP mysqlquery::lastid怎么用?PHP mysqlquery::lastid使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mysqlquery
的用法示例。
在下文中一共展示了mysqlquery::lastid方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: RepPostVar
//排序
$orderby = RepPostVar($_POST['orderby']);
$myorder = (int) $_POST['myorder'];
if ($orderby) {
$orderr = ReturnDoOrderF($tempr[modid], $orderby, $myorder);
$orderby = $orderr['returnf'];
} else {
$orderby = 'newstime';
}
//是否有历史记录
if ($searchid) {
$search_num = $empire->gettotal($query);
$sql = $empire->query("update {$dbtbpre}enewssearch set searchtime='{$searchtime}',result_num='{$search_num}',onclick=onclick+1,orderby='{$orderby}',myorder='{$myorder}',tempid='{$s_tempid}' where searchid='{$searchid}'");
if (empty($search_num)) {
$searchid = 0;
}
} else {
$search_num = $empire->gettotal($query);
if (empty($search_num)) {
$searchid = 0;
} else {
$iskey = $keyboardone == 1 ? 0 : 1;
$sql = $empire->query("insert into {$dbtbpre}enewssearch(searchtime,keyboard,searchclass,result_num,searchip,classid,onclick,orderby,myorder,checkpass,tbname,tempid,iskey,andsql,trueclassid) values('{$searchtime}','{$keyboard}','{$newsearchclass}','{$search_num}','{$ip}','{$classid}',1,'{$orderby}','{$myorder}','{$checkpass}','{$tbname}','{$s_tempid}','{$iskey}','{$andsql}','{$trueclassid}')");
$searchid = $empire->lastid();
}
}
//设置最后搜索时间
$set1 = esetcookie("lastsearchtime", $searchtime, $searchtime + 3600 * 24);
db_close();
$empire = null;
Header("Location:result/?searchid={$searchid}" . $dogetvar);