直做数据库,最近花了点时间把自己常用的东西封装在一起. DBHelper using System; using System.Collections.Generic; using System.Text; using System.Data; using System.Data.Common; using System.Reflection; namespace DBHelper { public sealed class DB : IDisposable { #region 数据库类型枚举
DB封装类 <?php class DBDA { public $host = "localhost"; public $uid = "root"; public $pwd = "root"; public $dbname = "mydb"; public function Query($sql,$type=1) //连接数据库,参数默认为1的时候为查询结果,其它的为增删改. { $db = new MySQLi($th