php_DBHelper包含【CURD】 demo ?phpclass DBHelper{private $host="localhost";private $userName="root";private $pwd="root";private $DBName="mytest";/** 获取数据 /function GetQuery($sql){ this-host, this-pwd, conn){echo "conn mysql erro
php_DBHelper 包含【CURD】 demo
<?php class DBHelper{ private $host="localhost"; private $userName="root"; private $pwd="root"; private $DBName="mytest"; /**
- 获取数据 / function GetQuery($sql){ this->host,this->pwd,conn){ echo "conn mysql error"; mysqli_close(conn,"set names utf8"); conn,conn); return $return; } /*
- 增删修函数 */ function NOQuery($sql){ this->host,this->pwd,conn){ echo "conn mysql error"; mysqli_close(conn,"set names utf8"); mysqli_query(sql); //获取操作行数 conn); mysqli_close($conn); return 符号 }
} #开始执行测试 $db=new DBHelper(); #添加数据 // $db->NOQuery("insert into users values(0,'damo','11','易筋经')"); #修改数据 // $db->NOQuery("update users set userName='达摩' where userName='damo'"); #删除数据 // result=result as $rows)