dashboard/include/SqlHelper.class.php

(开头部分) 5KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

<?php
      //这是 工具类,对数据库的 操作。
      class SqlHelper{
      	
      	public $conn;
      	public $dbname="bussite";
      	public $username="root";
      	public $password="3699";
      	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;
      	}
      	
      //封装
        //考虑分页情况的查询
        //$sql="select * from where 表名 limit 0,6 ";
        //$sql="select count(*) from 表名";
        public function execute_dql_fenye($sql1,$sql2,$fenyePage){
            //得到分页的数据
            $res=mysql_query($sql1,$this->conn) or die (mysql_errno());
            //$res=>array();
            //将数据转移到数组
            $arr=array();
            while($row=mysql_fetch_assoc($res)){
                $arr[]=$row;
            }
后面还有 99 行代码,购买后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。