/**
燕十八 公益PHP培训
课堂地址:YY频道88354001
学习社区:www.zixue.it
**/
<?php
class mysql{
private $host;
private $name;
private $pass;
private $table;
function __construct($host,$name,$pass,$table){
$this->host=$host;
$this->name=$name;
$this->pass=$pass;
$this->table=$table;
$this->connect();
}
function connect(){
$like= mysql_connect($this->host,$this->name,$this->pass)or die ($this->error()) ;
mysql_select_db($this->table,$like) or die("没有这个数据库呢:".$this->table);
function query($v){
return mysql_query($v);
}
function error(){
return mysql_error();
}
}
}
$db=new mysql('localhost','root','','webmysql','utf-8');
?>
那里错了,请大家指教.