Changeset 25427 for trunk/include/dblayer/functions_mysqli.inc.php
- Timestamp:
- Nov 10, 2013, 6:03:25 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/dblayer/functions_mysqli.inc.php
r25018 r25427 238 238 */ 239 239 240 /**241 * creates an array based on a query, this function is a very common pattern242 * used here243 *244 * @param string $query245 * @param string $fieldname optional246 * @return array247 */248 function array_from_query($query, $fieldname=false)249 {250 $array = array();251 252 $result = pwg_query($query);253 if (false === $fieldname)254 {255 while ($row = pwg_db_fetch_assoc($result))256 {257 $array[] = $row;258 }259 }260 else261 {262 while ($row = pwg_db_fetch_assoc($result))263 {264 $array[] = $row[$fieldname];265 }266 }267 return $array;268 }269 270 240 define('MASS_UPDATES_SKIP_EMPTY', 1); 271 241 /**
Note: See TracChangeset
for help on using the changeset viewer.