さて、何らかの理由でこのクエリ:
$db->sqlquery("INSERT INTO `password_reset` SET `user_email` = ?, `secret_code` = ?, `expires` = ?", array($email, $random_string, $next_week));
すべてのフィールドに「random_string」と入力しますが、その理由はわかりません。
これは私のクエリコードです:
public function sqlquery($sql, $objects = array())
{
global $core;
try
{
$this->STH = $this->database->prepare($sql);
foreach($objects as $k=>$p)
{
// +1 is needed as arrays start at 0 where as ? placeholders start at 1 in PDO
if(is_numeric($p))
{
$this->STH->bindParam($k+1, $p, PDO::PARAM_INT);
}
else
{
$this->STH->bindParam($k+1, $p, PDO::PARAM_STR);
}
}
return $this->STH->execute();
$this->counter++;
}
catch (PDOException $e)
{
$core->message($e->getMessage());
}
}
なぜそれがそうなるのか、何か考えはありますか?