即使我正好有两个绑定变量和两个标记,也遇到了无效的参数编号错误,我只需要插入这两个值,所以我将其余的列输入为null。这是
connecting::query('INSERT INTO accounts VALUES (null,null,null,\'0\',null,null,:something,null,null,null,null,null,null:somethingElse,null,null)', array(':social'=>$social,':noise'=>$noise));
这里是被调用的方法:
public static function query($query,$params = array())
{
$statement = self :: db()->prepare($query);
$statement->execute($params);
if(explode(' ',$query)[0] == 'SELECT')
{
$data = $statement->fetchAll();
return $data;
}
}