Ignore:
Timestamp:
Mar 25, 2005, 11:10:55 PM (19 years ago)
Author:
plg
Message:
  • new feature : caddie. The purpose is batch management, especially concerning elements to categories associations. This is the very first release, needs many improvements.
  • new function : array_from_query. Firstly used by "caddie" feature, it may be useful in many cases.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/functions.inc.php

    r749 r755  
    619619  die ($error);
    620620}
     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 */
     630function 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}
    621642?>
Note: See TracChangeset for help on using the changeset viewer.