This is my code:
if (!isset($_POST['cellulare'])) $cell = "-"; else $cell = $_POST['cellulare'];
if (!isset($_POST['ufficio'])) $uff = "-"; else $uff = $_POST['ufficio'];
if (!isset($_POST['email'])) $email = "-"; else $email= $_POST['email'];
$sqlup = "UPDATE rubrica SET nome = :nm,
cognome = :cgm,
mail = :email,
cellulare = :cell,
ufficio = :office,
WHERE id=".$_GET['mod'];
$stmt = $pdo->prepare($sqlup);
$stmt->bindParam(':nm', $_POST['nome'], PDO::PARAM_STR);
$stmt->bindParam(':cgm', $_POST['cognome'], PDO::PARAM_STR);
$stmt->bindParam(':email ', $email, PDO::PARAM_STR);
$stmt->bindParam(':cell', $cell, PDO::PARAM_STR);
$stmt->bindParam(':office', $uff, PDO::PARAM_STR);
$stmt->execute();
Apparently there is no error, but i get this:
Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[HY093]: Invalid parameter number: parameter was not defined'