The syntax for passing parameter strings in PHP is incorrect.

Source: Internet
Author: User
PHP parameter string syntax error

I am reading other people's code and find it difficult to pass parameters and single or double quotation marks in strings.

I pasted Dongdong, and basically removed the implementation.

I used other people's classes, and I don't know if it's right or not. let's take a look at it. it's always wrong. I 've pasted all the wrong places.

Call error
// The first $ 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],]); // The second $ datas = $ database-> insert ("ignore ", ["brand" = >$ _ POST ['brand'], "style" = >$ _ POST ['style'], "price" = >$ _ POST ['price'], "condition" = >$ _ POST ['condition'], "description" = >$ _ POST ['description'], 'image' => "upload /". $ _ FILES ["file"] ["name"]); // The Third $ datas = $ database-> select ("user", ["*"], ["where" => "email = ". $ _ POST ['email ']);




class AAAA{protected $database_type = 'mysql';// For MySQL, MSSQL, Sybaseprotected $server = 'localhost';protected $username = 'username';protected $password = 'password';// For SQLiteprotected $database_file = '';// Optionalprotected $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(){}}


Reply to discussion (solution)

The array () is abbreviated as [], which is only available in php5.4.

1. upgrade PHP to version 5.4.
2. change all [] to array ()

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.