本文整理汇总了PHP中SqlHelper::modify方法的典型用法代码示例。如果您正苦于以下问题:PHP SqlHelper::modify方法的具体用法?PHP SqlHelper::modify怎么用?PHP SqlHelper::modify使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SqlHelper
的用法示例。
在下文中一共展示了SqlHelper::modify方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: recordFail
function recordFail($xml)
{
$sql = "INSERT INTO tbl_rp_fail(return_code, return_msg, result_code,err_code,err_code_des,mch_billno,mch_id,wxappid,re_openid,total_amount)VALUES(\r\n'{$xml->return_code}','{$xml->return_msg}','{$xml->result_code}','{$xml->err_code}','{$xml->err_code_des}','{$xml->mch_billno}','{$xml->mch_id}','{$xml->wxappid}','{$xml->re_openid}',{$xml->total_amount}\r\n);";
$sh = new SqlHelper();
$sh->connDataBase(DB_WX_URL, DB_WX_USER, DB_WX_PWD, DB_WX_NAME);
return $sh->modify($sql);
}
示例2: record2DB
private function record2DB($openid, $key)
{
$sql = "UPDATE tbl_rbkey SET openid='{$openid}',used_date=NOW() WHERE rb_key ='{$key}' AND openid IS NULL;";
$st = new SqlHelper();
$st->connDataBase(DB_URL, DB_USER, DB_PWD, DB_RBKEY);
$result = $st->modify($sql);
$st->close();
return $result;
}
示例3: record2DB
private function record2DB($openid, $qList)
{
$sql = "INSERT INTO tbl_feedback VALUES('{$openid}',NOW(),'{$qList['0']}','{$qList['1']}','{$qList['2']}','{$qList['3']}','{$qList['4']}','{$qList['5']}','{$qList['6']}','{$qList['7']}');";
$st = new SqlHelper();
$st->conn();
$result = $st->modify($sql);
$st->close();
return $result;
}
示例4: update
private function update($gameId, $player_name)
{
$st = new SqlHelper();
$sql = "UPDATE tbl_player SET player_name='{$player_name}',last_login_utc=UNIX_TIMESTAMP(NOW()), last_login_date = NOW() WHERE game_id={$gameId}";
$st->conn();
$result = $st->modify($sql);
$st->close();
return $result;
}
示例5: statistic
/**
* 统计数据
* @param $params
* @param $res
*/
public function statistic(&$params, &$res)
{
$content = mysql_escape_string($params->content);
$sql = "INSERT INTO tbl_statistic(content, count) VALUES('%s', 1) ON DUPLICATE KEY UPDATE count = count + 1;";
$sql = sprintf($sql, $content);
$sqlHelper = new SqlHelper();
$sqlHelper->conn();
$sqlHelper->modify($sql);
}
示例6: lottery
/**
* 为玩家进行一次抽奖
* @param $id
* @param $score
*/
private function lottery($id, $score)
{
$level = 0;
if ($score >= 340) {
$level = 340;
} else {
if ($score >= 200) {
$level = 200;
} else {
if ($score >= 100) {
$level = 100;
}
}
}
$reward = array();
$reward['reward_key'] = 0;
$reward['reward_type'] = 0;
$code = rand(0, 9);
if ($code <= 2) {
$now = time();
//可以中奖,这里随机出一个奖励type
$sql = "UPDATE tbl_key SET user_id='%s',used_utc=%d WHERE level = %d AND user_id = '' ORDER BY RAND() LIMIT 1";
$sql = sprintf($sql, $id, $now, $level);
$st = new SqlHelper();
$st->conn();
$result = $st->modify($sql);
$affectedRows = mysql_affected_rows();
$st->close();
if (true == $result && $affectedRows > 0) {
$sql = "SELECT `key`,type FROM tbl_key WHERE user_id='%s' AND used_utc=%d";
$sql = sprintf($sql, $id, $now);
//die($sql);
$st->conn();
$result = $st->query($sql);
$st->close();
if (null != $result) {
$reward['reward_key'] = $result[0]['key'];
$reward['reward_type'] = $result[0]['type'];
}
}
}
return $reward;
}