diff --git a/database.php b/database.php index 7961967..1ac173d 100644 --- a/database.php +++ b/database.php @@ -824,10 +824,18 @@ class Database { $query = $this->database->prepare ( 'UPDATE `user`' . - 'SET `about` = ?, `email` = ? ' . - 'WHERE `id` = ?'); - - $query->execute (array ($about, $email, $user_id)); + 'SET `about` = :about, `email` = :email ' . + 'WHERE `id` = :user_id'); + + $query->bindValue (':about', $about, PDO::PARAM_STR); + $query->bindValue (':user_id', $user_id, PDO::PARAM_INT); + + if (NULL == $email || '' == $email) + $query->bindValue (':email', NULL, PDO::PARAM_NULL); + else + $query->bindValue (':email', $email, PDO::PARAM_STR); + + $query->execute (); } /**