Changeset 755 for trunk/include/functions.inc.php
- Timestamp:
- Mar 25, 2005, 11:10:55 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/functions.inc.php
r749 r755 619 619 die ($error); 620 620 } 621 622 /** 623 * creates an array based on a query, this function is a very common pattern 624 * used here 625 * 626 * @param string $query 627 * @param string $fieldname 628 * @return array 629 */ 630 function array_from_query($query, $fieldname) 631 { 632 $array = array(); 633 634 $result = pwg_query($query); 635 while ($row = mysql_fetch_array($result)) 636 { 637 array_push($array, $row[$fieldname]); 638 } 639 640 return $array; 641 } 621 642 ?>
Note: See TracChangeset
for help on using the changeset viewer.