当前位置: 首页>>代码示例>>PHP>>正文


PHP pwSqlSingle函数代码示例

本文整理汇总了PHP中pwSqlSingle函数的典型用法代码示例。如果您正苦于以下问题:PHP pwSqlSingle函数的具体用法?PHP pwSqlSingle怎么用?PHP pwSqlSingle使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了pwSqlSingle函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: update

 function update($nkey, $array)
 {
     $array['nkey'] || ($array['nkey'] = $nkey);
     $array['type'] || ($array['type'] = $this->type);
     $array = $this->_checkData($array);
     $this->db->pw_update("SELECT nid FROM pw_nav WHERE type=" . pwEscape($this->type, false) . "AND nkey=" . pwEscape($nkey, false), "UPDATE pw_nav SET" . pwSqlSingle($array, false) . " WHERE type=" . pwEscape($this->type, false) . "AND nkey=" . pwEscape($nkey, false), "INSERT INTO pw_nav SET" . pwSqlSingle($array, false));
 }
开发者ID:adi00,项目名称:wumaproject,代码行数:7,代码来源:navmenu.class.php

示例2: execute

 function execute(&$postdata)
 {
     global $timestamp, $db_ptable, $onlineip;
     $this->setPostData($postdata);
     $pwSQL = pwSqlSingle(array('fid' => $this->data['fid'], 'icon' => $this->data['icon'], 'author' => $this->data['author'], 'authorid' => $this->data['authorid'], 'subject' => $this->data['title'], 'ifcheck' => $this->data['ifcheck'], 'type' => $this->data['w_type'], 'postdate' => $timestamp, 'lastpost' => $timestamp, 'lastposter' => $this->data['lastposter'], 'hits' => 1, 'replies' => 0, 'topped' => $this->data['topped'], 'digest' => $this->data['digest'], 'special ' => $this->data['special'], 'state' => 0, 'ifupload' => $this->data['ifupload'], 'ifmail' => $this->data['ifmail'], 'anonymous' => $this->data['anonymous'], 'ptable' => $db_ptable, 'ifmagic' => $this->data['ifmagic'], 'ifhide' => $this->data['hideatt'], 'tpcstatus' => $this->data['tpcstatus'], 'modelid' => $this->data['modelid']));
     $this->db->update("INSERT INTO pw_threads SET {$pwSQL}");
     $this->tid = $this->db->insert_id();
     # memcache refresh
     $threadList = L::loadClass("threadlist");
     $threadList->updateThreadIdsByForumId($this->data['fid'], $this->tid);
     $pw_tmsgs = GetTtable($this->tid);
     if (is_object($postdata->tag)) {
         $postdata->tag->insert($this->tid);
         $this->data['tags'] .= "\t" . $postdata->tag->relate($this->data['title'], $this->data['content']);
     }
     if (is_object($this->att) && ($aids = $this->att->getAids())) {
         $this->att->pw_attachs->updateById($aids, array('tid' => $this->tid));
     }
     $ipTable = L::loadClass('IPTable');
     $pwSQL = pwSqlSingle(array('tid' => $this->tid, 'aid' => $this->data['aid'], 'userip' => $onlineip, 'ifsign' => $this->data['ifsign'], 'buy' => '', 'ipfrom' => $ipTable->getIpFrom($onlineip), 'tags' => $this->data['tags'], 'ifconvert' => $this->data['convert'], 'ifwordsfb' => $this->data['ifwordsfb'], 'content' => $this->data['content'], 'magic' => $this->data['magic']));
     $this->db->update("INSERT INTO {$pw_tmsgs} SET {$pwSQL}");
     if ($this->data['digest']) {
         $this->db->update("UPDATE pw_memberdata SET digests=digests+1 WHERE uid=" . pwEscape($this->data['authorid']));
         $this->post->user['digests']++;
     }
     $this->post->updateUserInfo($this->type, $this->creditSet(), $this->data['content']);
     $this->afterpost();
 }
开发者ID:adi00,项目名称:wumaproject,代码行数:28,代码来源:topicpost.class.php

示例3: insert

 function insert($data)
 {
     $data['extra'] = $data['extra'] ? serialize($data['extra']) : '';
     $this->_db->update("INSERT INTO pw_weibo_content SET " . pwSqlSingle($data));
     $mid = $this->_db->insert_id();
     return $mid;
 }
开发者ID:sherlockhouse,项目名称:aliyun,代码行数:7,代码来源:weibo.php

示例4: updataById

 function updataById($tplid, $array)
 {
     $array = $this->_checkData($array);
     if (!$array) {
         return null;
     }
     $this->_db->update("UPDATE " . $this->_tableName . " SET " . pwSqlSingle($array, false) . " WHERE tplid=" . pwEscape($tplid));
 }
开发者ID:adi00,项目名称:wumaproject,代码行数:8,代码来源:tpl.db.php

示例5: 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 " . pwSqlSingle(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'])));
     }
 }
开发者ID:adi00,项目名称:wumaproject,代码行数:8,代码来源:mutiupload.class.php

示例6: writetoollog

function writetoollog($log)
{
    global $db, $db_bbsurl;
    $log['type'] = getLangInfo('toollog', $log['type']);
    $log['filename'] = Char_cv($log['filename']);
    $log['username'] = Char_cv($log['username']);
    $log['descrip'] = Char_cv(getLangInfo('toollog', $log['descrip'], $log));
    $db->update("INSERT INTO pw_toollog SET " . pwSqlSingle(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'])));
}
开发者ID:adi00,项目名称:wumaproject,代码行数:9,代码来源:tool.php

示例7: insertData

 function insertData($array)
 {
     $array = $this->_checkData($array);
     if (!$array || !$array['invokepieceid'] || !$array['fid'] || !$array['loopid']) {
         return null;
     }
     $this->_db->update("REPLACE INTO " . $this->_tableName . " SET " . pwSqlSingle($array, false));
     return $this->_db->insert_id();
 }
开发者ID:adi00,项目名称:wumaproject,代码行数:9,代码来源:cachedata.db.php

示例8: add

 function add($uid, $appid, $appname, $allowfeed, $descrip)
 {
     global $timestamp;
     $this->db->query_unbuffered("REPLACE INTO " . UC_DBTABLEPRE . "userapp SET " . pwSqlSingle(array('uid' => $uid, 'appid' => $appid, 'appname' => $appname, 'allowfeed' => $allowfeed)));
     if ($allowfeed) {
         $descrip = Char_cv($descrip);
         $this->db->query_unbuffered("INSERT INTO " . UC_DBTABLEPRE . "feed SET " . pwSqlSingle(array('uid' => $uid, 'type' => 'app', 'descrip' => $descrip, 'timestamp' => $timestamp), false));
     }
     return new ApiResponse(true);
 }
开发者ID:noikiy,项目名称:ecmall,代码行数:10,代码来源:class_UserApp.php

示例9: writeforumlog

function writeforumlog($log)
{
    $log['username1'] = Char_cv($log['username1']);
    $log['username2'] = Char_cv($log['username2']);
    $log['field1'] = Char_cv($log['field1']);
    $log['field2'] = Char_cv($log['field2']);
    $log['field3'] = Char_cv($log['field3']);
    $log['descrip'] = Char_cv(getLangInfo('log', $log['descrip'], $log));
    $GLOBALS['db']->update("INSERT INTO pw_forumlog SET " . pwSqlSingle(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));
}
开发者ID:adi00,项目名称:wumaproject,代码行数:10,代码来源:writelog.php

示例10: publishTemplatizedAction

 function publishTemplatizedAction($uid, $descrip, $appid)
 {
     //插入动态信息
     global $timestamp;
     $rt = $this->db->get_one("SELECT allowfeed FROM pw_userapp WHERE uid=" . pwEscape($uid) . " AND appid=" . pwEscape($appid));
     if ($rt['allowfeed']) {
         $descrip = Char_cv($descrip);
         $this->db->update("INSERT INTO pw_feed SET " . pwSqlSingle(array('uid' => $uid, 'type' => 'app', 'descrip' => $descrip, 'timestamp' => $timestamp), false));
         return new ApiResponse(true);
     }
     return new ApiResponse(false);
 }
开发者ID:adi00,项目名称:wumaproject,代码行数:12,代码来源:class_Feed.php

示例11: set

 /**
  * 更新指定KEY的缓存数据
  *
  * @param string $key 缓存KEY
  * @param string $value
  * @param int $expire
  * @return bool
  */
 function set($key, $value, $expire = 180)
 {
     if ($expire > 0) {
         $expire = $this->now + $expire;
         $v = $this->_serialize($value);
         $vhash = md5($v);
         $tmpvhash = $this->cache->get_value("SELECT vhash FROM " . $this->table . " WHERE skey=" . pwEscape($key, false));
         if ($vhash != $tmpvhash) {
             $dcache = array('skey' => $key, 'expire' => $expire, 'vhash' => $vhash, 'value' => $v);
             $this->cache->update("REPLACE INTO " . $this->table . " SET " . pwSqlSingle($dcache, false));
         } else {
             $this->cache->update("UPDATE " . $this->table . " SET expire=" . pwEscape($expire, false) . "WHERE skey=" . pwEscape($key, false));
         }
     }
     $this->_expire();
 }
开发者ID:adi00,项目名称:wumaproject,代码行数:24,代码来源:dbcache.class.php

示例12: update

 function update($uploaddb)
 {
     foreach ($uploaddb as $key => $value) {
         if ($value['attname'] == 'postcate' && ($value['id'] == '13' || $value['id'] == '27')) {
             $fieldname = 'pcattach';
         } else {
             $fieldname = 'field' . $value['id'];
         }
         $this->attachs[$fieldname] = $value['fileuploadurl'];
         if ($value['attname'] == 'topic') {
             $tablename = GetTopcitable($this->pcid);
         } elseif ($value['attname'] == 'postcate') {
             $tablename = GetPcatetable($this->pcid);
         }
         if ($this->attachs) {
             $this->db->update("UPDATE {$tablename} SET " . pwSqlSingle($this->attachs) . " WHERE tid=" . pwEscape($this->tid));
         }
     }
 }
开发者ID:adi00,项目名称:wumaproject,代码行数:19,代码来源:pcupload.class.php

示例13: syncredit

 function syncredit($arr)
 {
     if (is_array($arr)) {
         foreach ($arr as $uid => $setv) {
             $sql = '';
             foreach ($setv as $cid => $value) {
                 if (is_numeric($cid)) {
                     $value = intval($value);
                     $this->db->pw_update("SELECT uid FROM pw_membercredit WHERE uid=" . pwEscape($uid) . ' AND cid=' . pwEscape($cid), "UPDATE pw_membercredit SET value=" . pwEscape($value) . ' WHERE uid=' . pwEscape($uid) . ' AND cid=' . pwEscape($cid), "INSERT INTO pw_membercredit SET " . pwSqlSingle(array('uid' => $uid, 'cid' => $cid, 'value' => $value)));
                 } elseif (in_array($cid, array('money', 'rvrc', 'credit', 'currency'))) {
                     $cid == 'rvrc' && ($value *= 10);
                     $sql .= ",{$cid}=" . pwEscape(intval($value));
                 }
             }
             if ($sql) {
                 $this->db->update("UPDATE pw_memberdata SET " . ltrim($sql, ',') . " WHERE uid=" . pwEscape($uid), 0);
             }
         }
     }
     return new ApiResponse(1);
 }
开发者ID:adi00,项目名称:wumaproject,代码行数:21,代码来源:class_Credit.php

示例14: autoban

function autoban($uid)
{
    global $db, $db_banby, $db_banmax, $db_bantype, $db_banlimit, $timestamp;
    $rt = $db->get_one('SELECT m.groupid,m.memberid,md.postnum,md.rvrc,md.money FROM pw_members m LEFT JOIN pw_memberdata md ON md.uid=m.uid WHERE m.uid=' . pwEscape($uid));
    if ($rt['groupid'] == '-1' || $rt['groupid'] == '6') {
        switch ($db_banby) {
            case 1:
                $banby = $rt['postnum'];
                break;
            case 2:
                $banby = $rt['rvrc'] / 10;
                break;
            case 3:
                $banby = $rt['money'];
                break;
            default:
                $banby = $rt['postnum'];
        }
        if ($rt['groupid'] == '-1') {
            if ($banby < $db_banmax) {
                $db->update("UPDATE pw_members SET groupid='6' WHERE uid=" . pwEscape($uid));
                $pwSQL = pwSqlSingle(array('uid' => $uid, 'fid' => 0, 'type' => $db_bantype, 'startdate' => $timestamp, 'days' => $db_banlimit, 'admin' => 'autoban', 'reason' => ''));
                $db->update("REPLACE INTO pw_banuser SET {$pwSQL}");
            }
        } elseif ($banby >= $db_banmax) {
            $bandb = $db->get_one("SELECT id FROM pw_banuser WHERE uid=" . pwEscape($uid) . " AND fid='0'");
            if (!$bandb) {
                $db->update("UPDATE pw_members SET groupid='-1' WHERE uid=" . pwEscape($uid));
            } elseif ($bandb['type'] == 1 && $timestamp - $bandb['startdate'] > $bandb['days'] * 86400) {
                $db->update("UPDATE pw_members SET groupid='-1' WHERE uid=" . pwEscape($uid));
                $db->update("DELETE FROM pw_banuser WHERE id=" . pwEscape($bandb['id']));
            }
        }
        $_cache = getDatastore();
        $_cache->delete('UID_' . $uid);
    }
}
开发者ID:adi00,项目名称:wumaproject,代码行数:37,代码来源:autoban.php

示例15: pwSendMsg

/**
 * 发送社区短消息或系统通知
 *
 * @param array $msg 信息格式如下:
 * 	$msg = array(
 *		'toUser'	=> 'admin', //接收者用户名,可为数组群发:array('admin','abc')
 *		'toUid'		=> 1,		//接收者uid,可为数组群发:array(1,2),当与 toUser 同时存在时,自然失效
 *		'fromUid'	=> 2,		//发送者UID,与fromUser同时存在才有效 (可选,默认为'0')
 *		'fromUser'	=> 'pwtest',//发送者用户名,与fromUid同时存在才有效(可选,默认为'SYSTEM')
 *		'subject'	=> 'Test',	//消息标题
 *		'content'	=> '~KO~',	//消息内容
 *		'other'		=> array()	//其他信息变量
 *	);
 * @return boolean 返回消息发送是否完成
 */
function pwSendMsg($msg)
{
    global $db, $timestamp;
    if (!$msg['toUser'] && !$msg['toUid'] || !$msg['subject'] || !$msg['content']) {
        return false;
    }
    $toType = 'username';
    if (empty($msg['toUser'])) {
        $msg['toUser'] = $msg['toUid'];
        $toType = 'uid';
    }
    $msg['subject'] = getLangInfo('writemsg', $msg['subject'], $msg);
    $msg['content'] = getLangInfo('writemsg', $msg['content'], $msg);
    if (!$msg['fromUid'] || !$msg['fromUser']) {
        $msg['fromUid'] = 0;
        $msg['fromUser'] = 'SYSTEM';
    }
    if (is_array($msg['toUser'])) {
        //group send message
        $msgdb = array();
        $query = $db->query("SELECT uid FROM pw_members WHERE {$toType} IN (" . pwImplode($msg['toUser'], false) . ')');
        while ($rt = $db->fetch_array($query)) {
            $msgdb[] = array($rt['uid'], $msg['fromUid'], $msg['fromUser'], 'rebox', 1, $timestamp, $msg['subject'], $msg['content']);
        }
        $msgdb && send_msgc($msgdb, false);
    } else {
        $rt = $db->get_one("SELECT uid FROM pw_members WHERE {$toType}=" . pwEscape($msg['toUser'], false));
        if (empty($rt)) {
            return false;
        }
        $db->update('INSERT INTO pw_msg SET ' . pwSqlSingle(array('touid' => $rt['uid'], 'fromuid' => $msg['fromUid'], 'username' => $msg['fromUser'], 'type' => 'rebox', 'ifnew' => 1, 'mdate' => $timestamp), false));
        $mid = $db->insert_id();
        $db->update('REPLACE INTO pw_msgc SET ' . pwSqlSingle(array('mid' => $mid, 'title' => $msg['subject'], 'content' => $msg['content']), false));
        $db->update("UPDATE pw_members SET newpm=newpm+1 WHERE uid=" . pwEscape($rt['uid'], false));
    }
    return true;
}
开发者ID:adi00,项目名称:wumaproject,代码行数:52,代码来源:msg.php


注:本文中的pwSqlSingle函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。