From 037d8733662df4f0219f4250a27db41236ca5c24 Mon Sep 17 00:00:00 2001 From: Yannick Warnier Date: Thu, 31 Jan 2008 03:17:58 +0100 Subject: [PATCH] [svn r14213] Added Database::fetch_row() to ease transition to db independent functions --- main/inc/lib/database.lib.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/main/inc/lib/database.lib.php b/main/inc/lib/database.lib.php index 373f56c785..08fbcc67bd 100644 --- a/main/inc/lib/database.lib.php +++ b/main/inc/lib/database.lib.php @@ -654,6 +654,16 @@ class Database } return mysql_fetch_object($res); } + /** + * Gets the array from a SQL result (as returned by api_sql_query) - help achieving database independence + * @param resource The result from a call to sql_query (e.g. api_sql_query) + * @return array Array of results as returned by php (mysql_fetch_row) + * @author Yannick Warnier + */ + function fetch_row($res) + { + return mysql_fetch_row($res); + } /** * Gets the number of rows from the last query result - help achieving database independence * @param resource The result