これが私の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]:無効なパラメーター番号:パラメーターがで定義されていません...
だから、私は何が間違っているのですか?
編集:これが配列です:
(
[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
)
ありがとう!