php实现Mysql简易操作类
这个PHP实现的mysql的操作类完整版已经使用过了,而这个简化版是经过修改完整版后的简化版,适用在一般的 PHP 应用中,功能上可以实现基本的增删改查的操作,以
自己封装的Mysql简易操作类,已塞在Ben框架中,基于PDO来写的,,代码风格上有些无厘头。。。
mysql.class.php
server = $server;
$this->database = $database;
$this->user = $user;
$this->password = $password;
parent::__construct("mysql:host=$server;port=$port;dbname=$database",$user,$password);
$this->query('SET NAMES utf8');
}
public function drop($table){
$sql = 'DROP TABLE '.$table.';';
$re = $this->query($sql);
if($re){
return true;
}else{
return false;
}
}
public function insert($table,$name,$value=null){
$sql = "INSERT INTO ".$table.'(';
if($value == null){
$arrname = array_keys($name);
$arrvalue = array_values($name);
}else{
$arrname = explode('|', $name);
$arrvalue = explode('|', $value);
}
for($i=0;$i

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics









