本文整理匯總了PHP中s::sqlSingle方法的典型用法代碼示例。如果您正苦於以下問題:PHP s::sqlSingle方法的具體用法?PHP s::sqlSingle怎麽用?PHP s::sqlSingle使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類s
的用法示例。
在下文中一共展示了s::sqlSingle方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: array
$config = array();
$config['ddate'] = $config['dweek'] = $config['dtime'] = '';
if (is_array($ddate)) {
$config['ddate'] = implode(',', $ddate);
}
if (is_array($dweek)) {
$config['dweek'] = implode(',', $dweek);
}
if (is_array($dtime) && count($dtime) < 24) {
$config['dtime'] = implode(',', $dtime);
}
$config = addslashes(serialize($config));
if ($id) {
$db->update("UPDATE pw_searchadvert SET " . s::sqlSingle(array('keyword' => $advert['keyword'], 'starttime' => $advert['starttime'], 'endtime' => $advert['endtime'], 'code' => $advert['code'], 'ifshow' => $advert['ifshow'], 'orderby' => $advert['orderby'], 'config' => $config)) . " WHERE id=" . pwEscape($id));
} else {
$db->update("INSERT INTO pw_searchadvert SET " . s::sqlSingle(array('keyword' => $advert['keyword'], 'starttime' => $advert['starttime'], 'endtime' => $advert['endtime'], 'code' => $advert['code'], 'ifshow' => $advert['ifshow'], 'orderby' => $advert['orderby'], 'config' => $config)));
$id = $db->insert_id();
}
updatecache_search();
adminmsg('operate_success', "{$basename}&action={$action}");
} elseif ($job == 'del') {
s::gp(array('selid', 'id'));
if ($id) {
$selid = array($id);
}
if (!($selid = checkselid($selid))) {
//過濾
adminmsg('operate_error', "{$basename}&action={$action}");
}
$db->update("DELETE FROM pw_searchadvert WHERE id IN ({$selid})");
//已經過濾