可以这样来调用:require_once('Database.php');
class test{
var $host,$Dbname,$user,$pwd;
function test( $host,$Dbname,$user,$pwd ){
$this->host = $host;
$this->Dbname = $Dbname;
$this->user = $user;
$this->pwd = $pwd;
}
}$conn = new test( 'localhost','test','root','root');$colum = array(
"user" => "admin",
"pass" => "admin000",
"email" => "[email protected]
);$choice = array(
"tbl_name" => "test",
"WHERE" => "user <> ''",
"ORDER BY" => "id desc",
"LIMIT" => "30"
);$getSql = new MakeSql( $conn );
$getSql->selectDb( $conn );
echo $getSql->MakeSqlType( 'insert', $colum, $choice );
似乎还是不够抽象,匹配的条件要在数组里面写.大家还有没有好的构造sql的类拿出来共享下,谢谢!