From a0a6b857f53fc5ca597717c7726573f8f42c89e2 Mon Sep 17 00:00:00 2001 From: jbousquie Date: Thu, 1 Dec 2016 10:23:20 +0100 Subject: [PATCH] ajout db_num_rows() --- admin/db_access.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/admin/db_access.php b/admin/db_access.php index a2f085a..62452b9 100644 --- a/admin/db_access.php +++ b/admin/db_access.php @@ -28,11 +28,18 @@ function db_fetch_column_names(&$res) { $fields = $res->fetch_fields(); $col_names = array(); foreach($fields as $col) { - $col_names[] = $fields->name; + $col_names[] = $col->name; } return $col_names; } +// Fonction : db_num_rows() +// Renvoie le nombre de ligne d'un résultat +function db_num_rows(&$res) { + $num = $res->num_rows; + return $num; +} + // Fonction db_escape_string // Retourne ûne chaîne échappée function db_escape_string(&$db, $string) {