Я хотел перейти с обычного запроса MySQL на PDO, но с тех пор я даже не могу отследить ошибку.
Есть ли кто-нибудь, кто может мне помочь?Любая подсказка будет оценена!
Q1: что не так?Q2: как вообще можно отследить ошибку?
<?php
// Check if add button active, start this
if (isset($_POST['create'])) {
$new=htmlspecialchars($_POST['newgroup']);
$sql = "INSERT INTO contactgroups (status, gr_name) VALUES(1, : new )";
$sql->bindvalue( ': new', $new);
$sql->execute();
$arr = $sql->errorInfo();
echo $arr;
echo "<meta http-equiv=\"refresh\" content=\"0;URL=groups.php\">";
}
?>
<form id="group-in" method="post" action="groups.php">
Add new Distribution group: <input type="text" name="newgroup" placeholder="name..."> <input type="submit" name="create" value="Create new">
Rename groupname: <input type="text" value="<?php echo $result['gr_name']; ?>"> <input type="submit" name="rename" value="Rename">
</form>
приходит $ _POST, запускается SQL, но после bindPARAM / bindVALUE ничего не приходит ...