本文整理汇总了PHP中S::sqlSingle方法的典型用法代码示例。如果您正苦于以下问题:PHP S::sqlSingle方法的具体用法?PHP S::sqlSingle怎么用?PHP S::sqlSingle使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类S
的用法示例。
在下文中一共展示了S::sqlSingle方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: update
function update($uploaddb)
{
$fieldService = L::loadClass('ActivityField', 'activity');
if ($this->tid) {
$defaultAttach = $userAttach = array();
foreach ($uploaddb as $key => $value) {
if ($value['id']) {
$attach = array();
$attach = $fieldService->getField($value['id']);
$this->attachs[$attach['fieldname']] = $value['fileuploadurl'];
if ($attach['fieldname'] && $attach['ifdel'] == 1) {
$userAttach[$attach['fieldname']] = $value['fileuploadurl'];
} elseif ($attach['fieldname'] && !$attach['ifdel']) {
$defaultAttach[$attach['fieldname']] = $value['fileuploadurl'];
}
}
}
$defaultValueTableName = getActivityValueTableNameByActmid();
$userDefinedValueTableName = getActivityValueTableNameByActmid($this->actmid, 1, 1);
if ($defaultAttach) {
$this->db->update("UPDATE {$defaultValueTableName} SET " . S::sqlSingle($defaultAttach) . " WHERE tid=" . S::sqlEscape($this->tid));
}
if ($userAttach) {
$this->db->update("UPDATE {$userDefinedValueTableName} SET " . S::sqlSingle($userAttach) . " WHERE tid=" . S::sqlEscape($this->tid));
}
} else {
foreach ($uploaddb as $key => $value) {
$this->attachs['fileuploadurl'] = $value['fileuploadurl'];
}
}
return true;
}
示例2: updataById
function updataById($tplid, $array)
{
$array = $this->_checkData($array);
if (!$array) {
return null;
}
$this->_db->update("UPDATE " . $this->_tableName . " SET " . S::sqlSingle($array, false) . " WHERE tplid=" . S::sqlEscape($tplid));
}
示例3: update
function update($uploaddb)
{
$attaches = array();
foreach ($uploaddb as $v) {
$attaches['attach' . $v['id']] = $v['fileuploadurl'];
}
$attaches && $this->db->pw_update("SELECT * FROM pw_auth_certificate WHERE uid=" . S::sqlEscape($this->uid), "UPDATE pw_auth_certificate SET " . S::sqlSingle($attaches) . ' WHERE uid=' . $this->uid, "INSERT INTO pw_auth_certificate SET " . S::sqlSingle($attaches) . ',state=0,uid=' . $this->uid);
}
示例4: update
function update($sign, $array)
{
$array = $this->_checkData($array);
if (!$array) {
return null;
}
$this->_db->update('UPDATE ' . $this->_tableName . ' SET ' . S::sqlSingle($array, false) . ' WHERE sign=' . S::sqlEscape($sign));
}
示例5: writetoollog
function writetoollog($log)
{
global $db, $db_bbsurl;
$log['type'] = getLangInfo('toollog', $log['type']);
$log['filename'] = S::escapeChar($log['filename']);
$log['username'] = S::escapeChar($log['username']);
$log['descrip'] = S::escapeChar(getLangInfo('toollog', $log['descrip'], $log));
$db->update("INSERT INTO pw_toollog SET " . S::sqlSingle(array('type' => $log['type'], 'filename' => $log['filename'], 'nums' => $log['nums'], 'money' => $log['money'], 'descrip' => $log['descrip'], 'uid' => $log['uid'], 'touid' => $log['touid'], 'username' => $log['username'], 'ip' => $log['ip'], 'time' => $log['time'])));
}
示例6: add
function add($array)
{
$array = $this->_checkData($array);
if (!$array) {
return false;
}
$this->_db->update("INSERT INTO " . $this->_tableName . " SET " . S::sqlSingle($array, false));
return $this->_db->insert_id();
}
示例7: _insertData
function _insertData($array)
{
$array = $this->_checkData($array);
if (!$array || !$array['invokepieceid'] || !$array['data']) {
return null;
}
$this->_db->update("INSERT INTO " . $this->_tableName . " SET " . S::sqlSingle($array, false));
return $this->_db->insert_id();
}
示例8: replaceData
function replaceData($array)
{
$array = $this->_checkData($array);
if (!$array || !$array['name']) {
return null;
}
$this->_db->update("REPLACE INTO " . $this->_tableName . " SET " . S::sqlSingle($array, false));
return $this->_db->insert_id();
}
示例9: writeforumlog
function writeforumlog($log)
{
$log['username1'] = S::escapeChar($log['username1']);
$log['username2'] = S::escapeChar($log['username2']);
$log['field1'] = S::escapeChar($log['field1']);
$log['field2'] = S::escapeChar($log['field2']);
$log['field3'] = S::escapeChar($log['field3']);
$log['descrip'] = S::escapeChar(getLangInfo('log', $log['descrip'], $log));
$GLOBALS['db']->update("INSERT INTO pw_forumlog SET " . S::sqlSingle(array('type' => $log['type'], 'username1' => $log['username1'], 'username2' => $log['username2'], 'field1' => $log['field1'], 'field2' => $log['field2'], 'field3' => $log['field3'], 'descrip' => $log['descrip'], 'timestamp' => $log['timestamp'], 'ip' => $log['ip']), false));
}
示例10: updateByAlias
function updateByAlias($alias, $array)
{
$array = $this->_checkData($array);
if (!$array) {
return null;
}
if (isset($array['id'])) {
unset($array['id']);
}
return $this->_db->update("UPDATE " . $this->_tableName . " SET " . S::sqlSingle($array, false) . " WHERE alias=" . S::sqlEscape($alias));
}
示例11: update
function update($uploaddb)
{
global $db_charset, $timestamp;
foreach ($uploaddb as $key => $value) {
$value['name'] = pwConvert($value['name'], $db_charset, 'utf-8');
$this->db->update("INSERT INTO pw_attachs SET " . S::sqlSingle(array('fid' => 0, 'uid' => $this->uid, 'tid' => 0, 'pid' => 0, 'hits' => 0, 'name' => $value['name'], 'type' => $value['type'], 'size' => $value['size'], 'attachurl' => $value['fileuploadurl'], 'uploadtime' => $timestamp, 'ifthumb' => $value['ifthumb'])));
$aid = $this->db->insert_id();
$this->attachs[$aid] = array('aid' => $aid, 'name' => stripslashes($value['name']), 'type' => $value['type'], 'attachurl' => $value['fileuploadurl'], 'needrvrc' => $value['needrvrc'], 'special' => $value['special'], 'ctype' => $value['ctype'], 'size' => $value['size'], 'hits' => 0, 'desc' => str_replace('\\', '', $value['descrip']), 'ifthumb' => $value['ifthumb']);
}
return true;
}
示例12: setoParams
function setoParams($config)
{
global $db;
$updatecache = false;
foreach ($config as $key => $value) {
if (${'o_' . $key} != $value) {
$db->pw_update('SELECT hk_name FROM pw_hack WHERE hk_name=' . S::sqlEscape("o_{$key}"), 'UPDATE pw_hack SET ' . S::sqlSingle(array('hk_value' => $value, 'vtype' => 'string')) . ' WHERE hk_name=' . S::sqlEscape("o_{$key}"), 'INSERT INTO pw_hack SET ' . S::sqlSingle(array('hk_name' => "o_{$key}", 'vtype' => 'string', 'hk_value' => $value)));
$updatecache = true;
}
}
$updatecache && updatecache_conf('o', true);
}
示例13: publishTemplatizedAction
function publishTemplatizedAction($uid, $descrip, $appid)
{
//插入动态信息
global $timestamp;
//$rt = $this->db->get_one("SELECT * FROM pw_userapp WHERE uid=".S::sqlEscape($uid)." AND appid=".S::sqlEscape($appid));
$appclient = L::loadClass('appclient');
$rt = $appclient->getUserAppByUidAndAppid($uid, $appid);
if ($rt['allowfeed']) {
$descrip = S::escapeChar($descrip);
$this->db->update("INSERT INTO pw_feed SET " . S::sqlSingle(array('uid' => $uid, 'type' => 'app', 'descrip' => $descrip, 'timestamp' => $timestamp), false));
return new ApiResponse(true);
}
return new ApiResponse(false);
}
示例14: advertRecord
/**
* Ìí¼Ó
* @param int $uid
* @param string $username
* @return null
*/
function advertRecord($uid = 0, $username = '')
{
global $onlineip, $timestamp, $db, $winduid, $inv_linktype, $inv_linkscore, $inv_linkcredit;
if (empty($uid) || empty($username)) {
return false;
}
$sql = "SELECT ip FROM pw_inviterecord WHERE uid=" . S::sqlEscape($uid) . " AND ip=" . S::sqlEscape($onlineip) . "";
$rt = $db->get_one($sql);
if ($rt && $rt['ip'] == $onlineip) {
return false;
}
$visit = array('uid' => $uid, 'username' => $username, 'typeid' => $inv_linktype, 'reward' => $inv_linkscore, 'unit' => $inv_linkcredit, 'ip' => $onlineip, 'create_time' => $timestamp);
$sql = 'INSERT INTO pw_inviterecord SET ' . S::sqlSingle($visit);
$db->update($sql);
return true;
}
示例15: banUser
function banUser($uid)
{
$uid = intval($uid);
if ($uid < 1) {
return $this->buildResponse(USER_INVALID_PARAMS);
}
$timestamp = time();
$GLOBALS['db_cvtime'] != 0 && ($timestamp += $GLOBALS['db_cvtime'] * 60);
$userService = L::loadClass('UserService', 'user');
/* @var $userService PW_UserService */
$userService->update($uid, array('groupid' => 6));
$userService->setUserStatus($uid, PW_USERSTATUS_BANUSER, true);
$banArray = array('uid' => $uid, 'fid' => 0, 'type' => 2, 'startdate' => $timestamp, 'days' => 0, 'admin' => '', 'reason' => '');
$GLOBALS['db']->update("REPLACE INTO `pw_banuser` SET " . S::sqlSingle($banArray), false);
return $this->buildResponse(0);
}