21,887
社区成员
发帖
与我相关
我的任务
分享
// 第一个
$database = new AAAA([
'database_type' => 'mysql',
'database_name' => 'web_paris_station',
'server' => 'localhost',
'username' => 'root',
'password' => 'root',
'charset' => 'utf8',
'option' => [PDO::ATTR_CASE => PDO::CASE_NATURAL],
]);
// 第二个
$datas = $database->insert("sell", [
"brand" => $_POST['brand'],
"style" => $_POST['style'],
"price" => $_POST['price'],
"condition" => $_POST['condition'],
"description" => $_POST['description'],
'image' => "upload/" . $_FILES["file"]["name"]
]);
// 第三个
$datas = $database->select(
"user",
["*"],
["where" => "email = ".$_POST['email']]
);
class AAAA
{
protected $database_type = 'mysql';
// For MySQL, MSSQL, Sybase
protected $server = 'localhost';
protected $username = 'username';
protected $password = 'password';
// For SQLite
protected $database_file = '';
// Optional
protected $charset = 'utf8';
protected $database_name = '';
protected $option = array();
public function __construct($options)
{
}
public function query($query)
{
}
public function exec($query)
{
}
public function quote($string)
{
}
protected function array_quote($array)
{
}
protected function data_implode($data, $conjunctor, $outer_conjunctor = null)
{
}
public function where_clause($where)
{
}
public function select($table, $columns, $where = null)
{
}
public function insert($table, $data)
{
}
public function update($table, $data, $where = null)
{
}
public function delete($table, $where)
{
}
public function replace($table, $columns, $search = null, $replace = null, $where = null)
{
}
public function get($table, $columns, $where = null)
{
}
public function has($table, $where)
{
}
public function count($table, $where = null)
{
}
public function max($table, $column, $where = null)
{
}
public function min($table, $column, $where = null)
{
}
public function avg($table, $column, $where = null)
{
}
public function sum($table, $column, $where = null)
{
}
public function error()
{
}
public function last_query()
{
}
public function info()
{
}
}