php新手之mysql分页dbClass类


 1   
 2/**   
 3* a class use to connect the MySQL database and do some query   
 4* wayne ,Mar 11, 2002   
 5*/   
 6class dbClass {   
 7var $hostName = "localhost";   
 8var $dbName = "exhibit";   
 9var $Login = "wayne";   
10var $Password = "xiao";   
11var $conn;   
12var $result;   
13  
14function dbClass(){   
15$this->conn = mysql_connect("$hostName","$this->Login","$this->Password");   
16mysql_select_db("$this->dbName", $this->conn);   
17}   
18  
19function executeQuery($sql){   
20$this->result = mysql_query("$sql",$this->conn);   
21return $this->result;   
22}   
23  
24function closeConn(){   
25mysql_close($this->conn);   
26}   
27} 
Published At
Categories with 数据库类
Tagged with
comments powered by Disqus