dashboard/include/SqlHelper.class.php
(开头部分) 4KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
<?php
//这是 工具类,对数据库的 操作。
class SqlHelper{
public $conn;
public $dbname="emplayer";
public $username="root";
public $password="lb123";
public $host="localhost";
public function __construct($dbhost,$dbname,$dbpassword,$dbuser){
$this->host=$dbhost;
$this->dbname=$dbname;
$this->username=$dbuser;
$this->password=$dbpassword;
$this->conn=mysql_connect($this->host,$this->username,$this->password);
if(!$this->conn)
{
die("连接失败!".mysql_errno());
}
mysql_select_db($this->dbname);
}
//执行dql语句
public function execute_dql_a($sql){
$res=mysql_query($sql,$this->conn) or die(mysql_error());
return $res;
}
//执行dql语句,返回的是数组
public function execute_dql($sql){
$arr=array();
$res=mysql_query($sql,$this->conn) or die(mysql_error());
//吧res的数据集导入到数组里面去
while($row=mysql_fetch_assoc($res)){
$arr[]=$row;
}
mysql_free_result($res);
return $arr;
}
//分页公共查询语句
//$sql1=""select * from ... where ... limit 0,6";
//$sql2="select count(id) from 表";
public function execute_dql_fenye($sql1,$sql2,$fenyePage){
//这里查询到了要显示的分页数据
$res=mysql_query($sql1) or die(mysql_error());
//$ress=>array();
$arr=array();
while ($row=mysql_fetch_assoc($res)){
$arr[]=$row;
}
//把$arr付给$fenyePage
$fenyePage->res_array=$arr;
后面还有 70 行代码,购买后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。