diff options
author | Dries Buytaert <dries@buytaert.net> | 2007-08-11 14:14:46 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2007-08-11 14:14:46 +0000 |
commit | a5fcb369fb411d8ed3a945105a89a146ab96052e (patch) | |
tree | 0180d0a3acb057be7fd5fa49b320ae67fb522fb6 /includes/database.mysqli.inc | |
parent | 15c68075d9fe8350a78a9ac5969ecff1be2cee49 (diff) | |
download | brdo-a5fcb369fb411d8ed3a945105a89a146ab96052e.tar.gz brdo-a5fcb369fb411d8ed3a945105a89a146ab96052e.tar.bz2 |
- Patch #166205 by hswong3i: improved database compatibility of db_result(). Makes it work with DB2, Oracle, etc.
Diffstat (limited to 'includes/database.mysqli.inc')
-rw-r--r-- | includes/database.mysqli.inc | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/includes/database.mysqli.inc b/includes/database.mysqli.inc index 883bd72f6..38c3ce572 100644 --- a/includes/database.mysqli.inc +++ b/includes/database.mysqli.inc @@ -211,14 +211,14 @@ function db_num_rows($result) { * * @param $result * A database query result resource, as returned from db_query(). -* @param $row -* The index of the row whose result is needed. * @return * The resulting field or FALSE. */ -function db_result($result, $row = 0) { - if ($result && mysqli_num_rows($result) > $row) { - $array = mysqli_fetch_array($result, MYSQLI_NUM); +function db_result($result) { + if ($result && mysqli_num_rows($result) > 0) { + // The mysqli_fetch_row function has an optional second parameter $row + // but that can't be used for compatibility with Oracle, DB2, etc. + $array = mysqli_fetch_row($result); return $array[0]; } return FALSE; |