后台默认帐号和密码 admin 简介:建一个网站
源代码在线查看: db.config.php
include("config.php");
class db {
function connect(){
global $server,$mysql_name,$mysql_pass,$dbname;
$connect = mysql_connect($server,$mysql_name,$mysql_pass);
$select = mysql_select_db($dbname,$connect);
return $connect;
}
function query($sql){
$query = mysql_query($sql);
return $query;
}
function fetch_array($sql){
$fetch_array = mysql_fetch_array($sql);
return $fetch_array;
}
function num_rows($sql){
$query = $this->query($sql);
$num_rows = mysql_num_rows($query);
return $num_rows;
}
}
?>