本文整理汇总了PHP中SqlHelper::close方法的典型用法代码示例。如果您正苦于以下问题:PHP SqlHelper::close方法的具体用法?PHP SqlHelper::close怎么用?PHP SqlHelper::close使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SqlHelper
的用法示例。
在下文中一共展示了SqlHelper::close方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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;
}
示例2: 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;
}
示例3: 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;
}
示例4: 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;
}
示例5: 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;
}
示例6: 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;
}
示例7: CheckAdmin
public function CheckAdmin($id, $password)
{
$sqlHelper = new SqlHelper();
$sql = "select password,name from admin where id={$id}";
$res = $sqlHelper->res_array($sql);
if (md5($password) == $res[0]) {
return $res[1];
exit;
}
$sqlHelper->close();
return "";
}
示例8: checkStudent
public function checkStudent($sno, $pwd)
{
$arr_sno = array();
$sqlHelper = new SqlHelper();
$sql = "select usernc,pwd,sno from student where sno='{$sno}'";
$arr = $sqlHelper->res_array($sql);
if ($arr[1] == md5($pwd)) {
$arr_sno[0] = $arr[0];
$arr_sno[1] = $arr[2];
return $arr_sno;
//返回用户名
exit;
}
$sqlHelper->close();
return "";
}
示例9: get_rank
/**
* 获取排行榜
* @param $params
* @param $res
*/
public function get_rank(&$params, &$res)
{
$st = new SqlHelper();
$data = array();
$data['self'] = 1;
$id = mysql_escape_string($params->id);
$sql = "SELECT COUNT(*) AS position FROM tbl_user WHERE total_score > (SELECT total_score FROM tbl_user WHERE id = '%s')";
$sql = sprintf($sql, $id);
$st->conn();
$result = $st->query($sql);
$data['self'] = $result[0]['position'];
$st->close();
$sql = "SELECT id,name,pic,total_score FROM tbl_user ORDER BY total_score DESC LIMIT 0,20";
$st->conn();
$result = $st->query($sql);
$st->close();
$data['list'] = $result;
$res['data'] = $data;
return $result;
}
示例10: get_rank
/**
* 获取排行榜
* @param $params
* @param $res
*/
public function get_rank(&$params, &$res)
{
$st = new SqlHelper();
$data = array();
$data['self'] = 1;
// $id = mysql_escape_string($params->id);
// $sql = "SELECT COUNT(*) AS position FROM tbl_user WHERE total_score > (SELECT total_score FROM tbl_user WHERE id = '%s')";
// $sql = sprintf($sql, $id);
// $st->conn();
// $result = $st->query($sql);
// $data['self'] = $result[0]['position'];
// $st->close();
$sql = "SELECT tbl_record.id, tbl_record.game_id, name, SUM(score) AS score FROM tbl_record LEFT JOIN tbl_user ON tbl_record.id = tbl_user.id GROUP BY id,game_id ORDER BY score DESC LIMIT 0,20";
$st->conn();
$result = $st->query($sql);
$st->close();
$data['list'] = $result;
$res['data'] = $data;
return $result;
}