本文整理匯總了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);