From: Jérôme Benoit Date: Sun, 21 Jan 2018 09:58:06 +0000 (+0100) Subject: Code cleanups and comments X-Git-Url: https://git.piment-noir.org/?p=Project_webapp.git;a=commitdiff_plain;h=01adaa67ec825ce01c2921dca8ea4187a5efdb0e Code cleanups and comments Signed-off-by: Jérôme Benoit --- diff --git a/includes/formaccount.php b/includes/formaccount.php index 6e17999..32738c8 100644 --- a/includes/formaccount.php +++ b/includes/formaccount.php @@ -50,8 +50,8 @@ if (!empty($form_name) && !empty($form_firstname) && !empty($form_numstreet) && global $connection; $client_id = get_client_id($_SESSION['email']); $sql_pquery = "update CLIENTS - set NomCl = ?, PrenomCl = ?, EmailCl = ?, NumRueCl = ?, NomRueCl = ?, CodePosteCl = ?, VilleCl = ? - where NumCl = ?"; + set NomCl = ?, PrenomCl = ?, EmailCl = ?, NumRueCl = ?, NomRueCl = ?, CodePosteCl = ?, VilleCl = ? + where NumCl = ?"; $connection->prepare_query($sql_pquery); $connection->prepared_query_bind_param("sssisisi", array($form_name, $form_firstname, $form_email, $form_numstreet, $form_street, $form_postalcode, $form_city, $client_id)); $connection->run_prepared_query(); @@ -65,8 +65,8 @@ if (!empty($form_name) && !empty($form_firstname) && !empty($form_numstreet) && $client_id = get_client_id($_SESSION['email']); $hashed_password = password_hash($form_password, PASSWORD_DEFAULT); $sql_pquery = "update CLIENTS - set PasswordCl = ? - where NumCl = ?"; + set PasswordCl = ? + where NumCl = ?"; $connection->prepare_query($sql_pquery); $connection->prepared_query_bind_param("si", array($hashed_password, $client_id)); $connection->run_prepared_query(); diff --git a/includes/header.php b/includes/header.php index 13ce88c..31af395 100644 --- a/includes/header.php +++ b/includes/header.php @@ -9,7 +9,7 @@ include('lib/utils.php'); $configs = include('config.php'); /** - * [session_start start a unique session for the current browser client] + * session_start start a unique session for the current browser client */ session_start(); $is_logged_in = chk_logged_in(); diff --git a/lib/db.php b/lib/db.php index 1a870c4..9d967d6 100644 --- a/lib/db.php +++ b/lib/db.php @@ -57,7 +57,7 @@ class CustomDB /** * query method that permit to execute a SQL query * @param string $sql_query the SQL query to execute - * @return mysqli_result object or FALSE on failure and TRUE for queries + * @return object mysqli_result or FALSE on failure and TRUE for queries * without results */ public function query($sql_query) @@ -114,8 +114,8 @@ class CustomDB } /** - * [get_pquery_result description] - * @return [type] [description] + * get_pquery_result method to get the resultset of parametrized SQL query + * @return object mysqli_result resultset or FALSE for other DML queries or on failure */ public function get_pquery_result() {