is it me or there's some bugs around the PDO mysql drivers and class ?
this returns -> TRUE , . everthing 's all right
$sql = 'INSERT INTO table values(null,:login,:pswd) ';
try {
$stmt = db::get_conn()->prepare($sql);
$stmt->bindParam(':login', $login);
$stmt->bindParam(':pswd', $pswd);
$result = $stmt -> execute();
}
catch(PDOException $e)
{
$result ['pdo'] = $e->getMessage();
$result ['sql'] = $stmt;
}
return $result ;
}
BUT ! this return error !!?
(SQLSTATE[HY093]: Invalid parameter number: parameter was not defined')
$sql = 'INSERT INTO table values(null,:login,:pswd) ';
try {
$stmt = db::get_conn()->prepare($sql);
$result = $stmt -> execute(array($login,$pswd));
}
catch(PDOException $e)
{
$result ['pdo'] = $e->getMessage();
$result ['sql'] = $stmt;
}
return $result ;
}
Any idea why passing var in an array to execute() differ from the binparam version ?