本文整理汇总了PHP中SqlHelper类的典型用法代码示例。如果您正苦于以下问题:PHP SqlHelper类的具体用法?PHP SqlHelper怎么用?PHP SqlHelper使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了SqlHelper类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: addMessage
function addMessage($sender,$getter,$con) {
//创建SQL语句
$sql="insert into messages (sender,getter,content,sendTime) values('$sender','$getter','$con',now())";
file_put_contents("/Library/WebServer/Documents/ajax/mylog.txt",$sql."\r", FILE_APPEND);
$sqlHelper=new SqlHelper();
return $sqlHelper->execute_dml($sql);
}
示例3: ChangePassword
public function ChangePassword($username, $oldPassword, $newPassword)
{
$result = false;
$sql = "select password from t_admin where username='{$username}'";
//创建一个SqlHelper对象
$sqlHelper = new SqlHelper();
$res = $sqlHelper->execute_dql($sql);
if ($row = mysql_fetch_assoc($res)) {
//比对密码
if (md5($oldPassword) == $row['password']) {
$sql = "update t_admin set password='" . md5($newPassword) . "' where username='{$username}'";
if ($sqlHelper->execute_dml($sql) != 0) {
$result = true;
} else {
$this->errMessage = "更新失败!";
}
} else {
$this->errMessage = "原始密码不正确";
}
}
//资源
mysql_free_result($res);
//关闭链接
$sqlHelper->close_connect();
return $result;
}
示例4: showMessageByPage
public function showMessageByPage($fenyePage, $loginname)
{
$sql = "select *from message where getter = '" . $loginname . "'" . "limit " . $fenyePage->pageSize * ($fenyePage->page - 1) . "," . $fenyePage->pageSize;
$sqlHelper = new SqlHelper();
$res = $sqlHelper->execute_dql2($sql);
return $res;
}
示例5: get_reply
public function get_reply($bbs_id)
{
$sqlHelper = new SqlHelper();
$sql = "select * from reply where bbs_id={$bbs_id}";
$res = $sqlHelper->res_array_erwei($sql);
$sqlHelper->close();
return $res;
}
示例6: get_user_info
public function get_user_info($sno)
{
$sqlHelper = new SqlHelper();
$sql = "select sno,usernc,truename,email,tel,major,img from student where sno='{$sno}'";
$res = $sqlHelper->res_array($sql);
$sqlHelper->close();
return $res;
}
示例7: updateEmpUI
public function updateEmpUI($id, $name, $grade, $email)
{
$sql = "update emp set name='{$name}',grade={$grade},email='{$email}' where id={$id}";
$sqlHelper = new SqlHelper();
$res = $sqlHelper->execute_dml($sql);
$sqlHelper->close_connect();
return $res;
}
示例8: getStuListByPage
public function getStuListByPage($pageNow, $pageSize)
{
$sql = "select * from student limit " . ($pageNow - 1) * $pageSize . ",{$pageSize}";
$sqlHelper = new SqlHelper();
$res2 = $sqlHelper->execute_dql2($sql);
//free
return $res2;
}
示例9: get_question_gaicuo
public function get_question_gaicuo($paper_id)
{
$sqlHelper = new SqlHelper();
$sql = "select correct_name,correct_code,true_code from correct where paper_id='{$paper_id}'";
$arr = $sqlHelper->res_array_erwei($sql);
$sqlHelper->close();
return $arr;
}
示例10: 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;
}
示例11: insert_correct_question
public function insert_correct_question($correct_name, $correct_code, $true_code, $run_answer, $paper_id)
{
$sqlHelper = new SqlHelper();
$correct_code = str_replace("<", "\"", $correct_code);
$correct_code = str_replace(">", "\"", $correct_code);
$sql = "INSERT INTO `weike`.`correct` ( `correct_name`, `correct_code`, `true_code`, `run_answer`, `paper_id`) VALUES ( '{$correct_name}', '{$correct_code}', '{$true_code}', '{$run_answer}', '{$paper_id}')";
$res = $sqlHelper->dml($sql);
return $res;
}
示例12: 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;
}
示例13: getId
public function getId($tel)
{
$sqlHelper = new SqlHelper();
$user = new User();
$sql = "select id from user where tel='{$tel}'";
$res = $sqlHelper->dql_arr($sql);
$user->setId($res[0]['id']);
return $user;
}
示例14: 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;
}
示例15: getFenyePage
/**
* @param $fenyePage
*/
function getFenyePage($fenyePage)
{
$sqlhelper = new SqlHelper();
$sql1 = "select * from emp limit " . ($fenyePage->pageNow - 1) * $fenyePage->pageSize . "," . $fenyePage->pageSize;
echo "当前页:" . $fenyePage->pageNow . "<br/>";
echo $sql1;
$sql2 = "select count(id) from emp";
$sqlhelper->exectue_dql_fenye($sql1, $sql2, $fenyePage);
$sqlhelper->close_conn();
}