首页 新闻 会员 周边

建立了一个php+SQL类,却没有对数据库进行操作,也没有报错,求解

0
[已解决问题] 解决于 2015-04-18 16:28

<?php
class mysql{
private $host;
private $name;
private $pass;
private $table;
private $ut;

function _construct($host,$name,$pass,$table,$ut){
$this->host = $host;
$this->name = $name;
$this->pass = $pass;
$this->table = $table;
$this->ut=$ut;
$this->connet();
}
function connet(){
$link=mysql_connet($this->host,$this->name,$this->pass) or die(mysql_error());
mysql_select_db($this->table,$link)or die("没有连接数据库:".$this->table);
mysql_query("SET NAMES",$this->ut);
}
//常用函数 实现数据的增删改查
function mysql_query($v){
return mysql_query($v);
}
function arror($a){
return mysql_arror($a);
}
function insert_id(){
return mysql_arror();
}
function fetch_array(){
return mysql_arror();
}

//自定义函数,实现某些功能
function fn_inset($table,$name,$value){
$this->mysql_query("inset into $table($name) value ($value)");
}
}

$db = new mysql("localhost","root","bbs","GBK");
$db ->fn_inset("bbs","id,user,title,content,lastdate","'','我','们',now()");

?>

程序媛墨禾的主页 程序媛墨禾 | 菜鸟二级 | 园豆:205
提问于:2015-04-18 14:36
< >
分享
最佳答案
0

那就说明没错。

奖励园豆:5
Firen | 大侠五级 |园豆:5385 | 2015-04-18 16:18
其他回答(1)
0

新建了个页面,发现又可以了,醉了

程序媛墨禾 | 园豆:205 (菜鸟二级) | 2015-04-18 16:27
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册