本文整理汇总了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})");
//已经过滤