本文整理匯總了PHP中SqlHelper::res_array方法的典型用法代碼示例。如果您正苦於以下問題:PHP SqlHelper::res_array方法的具體用法?PHP SqlHelper::res_array怎麽用?PHP SqlHelper::res_array使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類SqlHelper
的用法示例。
在下文中一共展示了SqlHelper::res_array方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: 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;
}
示例2: get_counts
public function get_counts()
{
$sqlHelper = new SqlHelper();
$sql = "select count(*) from bbs";
$res = $sqlHelper->res_array($sql);
$rowcounts = $res[0];
//獲得總行數
$pagecount = ceil($rowcounts / 6);
//獲得總頁麵數
return $pagecount;
}
示例3: 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 "";
}
示例4: 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 "";
}
示例5: SqlHelper
<?php
/**
* Created by PhpStorm.
* User: хоП
* Date: 2015/11/29
* Time: 10:24
*/
require_once 'SqlHelper.class.php';
$sqlHelper = new SqlHelper();
$sql = "select * from student";
$res = $sqlHelper->res_array($sql);
foreach ($res as $key => $value) {
echo $key . "--" . $value;
}