Browse Source

[svn r14213] Added Database::fetch_row() to ease transition to db independent functions

Yannick Warnier 17 years ago
parent
commit
037d873366
1 changed files with 10 additions and 0 deletions
  1. 10 0
      main/inc/lib/database.lib.php

+ 10 - 0
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 <yannick.warnier@dokeos.com>
+	 */
+	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