如题.帮我看看错哪里了.
只有最后的那个插入错了 应该.
<?php
class mysql{
private $host=localhost;
private $root;
private $pass;
private $table;
private $bm;
function __construct($root,$pass,$table,$bm){
$this->host;
$this->root=$root;
$this->pass=$pass;
$this->table=$table;
$this->bm=$bm;
$this->fn_connect();
}
function fn_connect(){
$link=mysql_connect($this->host,$this->root,$this->pass) or die (mysql_error());
echo "连接成功";
$link_db=mysql_select_db($this->table,$link) or die ("连接数据库错误哈");
mysql_query("SET NAMES '$bm'") or die ($this->error()) ;
}
function fn_insert($table,$name,$value){
$this->query("insert into $table ($name) value($value)");
}
//===================================
function error(){
mysql_error();
}
}
$con=new mysql("root","","message","ugb");
$con->fn_insert('message','id,user,title,content,lastdate',"'','黄瓜是我','黄瓜好不好呢','测试黄瓜是不是新鲜的',now()");
?>