Home > Database > Mysql Tutorial > php入门mysql分页dbClass类_MySQL

php入门mysql分页dbClass类_MySQL

WBOY
Release: 2016-06-01 13:55:32
Original
1037 people have browsed it

/**
* a class use to connect the MySQL database and do some query
* wayne ,Mar 11, 2002
*/
class dbClass {
var $hostName = "localhost";
var $dbName = "exhibit";
var $Login = "wayne";
var $Password = "xiao";
var $conn;
var $result;

function dbClass(){
$this->conn = mysql_connect("$hostName","$this->Login","$this->Password");
mysql_select_db("$this->dbName", $this->conn);
}

function executeQuery($sql){
$this->result = mysql_query("$sql",$this->conn);
return $this->result;
}

function closeConn(){
mysql_close($this->conn);
}
}
?>

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template