这是我的 SQL 语句:
protected static $_SQLInsert = "INSERT INTO location
(host_id, street, suburb, region, post_code, country, phone, email,
timezone, longitude, latitude, is_main)
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)";
我准备声明如下:
static::$_PDOSInsert = self::$_PDO->prepare(static::$_SQLInsert);
准备一个包含 12 个值的数组后,我执行以下语句:
static::$_PDOSInsert->execute($array);
然后我收到以下警告:
PDOStatement::execute(): SQLSTATE[HY093]: Invalid parameter number: parameter was not defined in...
那么,我做错了什么???
编辑:这是数组:
(
[host_id] => 15
[street] => Street 15
[suburb] => Suburb 15
[region] => Region 15
[post_code] => Post Code 15
[country] => AU
[phone] => 12341234
[email] => asfd@email.com
[timezone] => 1
[longitude] => 123
[latitude] => 234
[is_main] => 1
)
谢谢!