PHP 传参数 字符串 语法错误

WBOY
發布: 2016-06-23 14:26:49
原創
1157 人瀏覽過

php 数据库

我在看别人代码,发现传参数 和 字符串中的 单双 引号比较困难

我把东东贴上来了,实现基本上都去掉了

用了别人的类, 也不知道对不对, 帮忙看看吧,反正总是错, 我把错的地方都贴上来了

调用出错的地方
// 第一个$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()	{			}}
登入後複製

回复讨论(解决方案)

将 array() 简写成 [] 是 php5.4 才有的功能

1.升级PHP版本到5.4
2.将所有[] 改成 array()

來源:php.cn
本網站聲明
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn
熱門教學
更多>
最新下載
更多>
網站特效
網站源碼
網站素材
前端模板