Changeset 1866 for trunk/include/functions.inc.php
- Timestamp:
- Feb 28, 2007, 4:07:12 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/functions.inc.php
r1864 r1866 1176 1176 1177 1177 /** 1178 * creates an hashed based on a query, this function is a very common 1179 * pattern used here. The key is given as parameter, the value is an associative 1180 * array. 1181 * 1182 * @param string $query 1183 * @param string $keyname 1184 * @return array 1185 */ 1186 function hash_from_query($query, $keyname) 1187 { 1188 $array = array(); 1189 $result = pwg_query($query); 1190 while ($row = mysql_fetch_assoc($result)) 1191 { 1192 $array[ $row[$keyname] ] = $row; 1193 } 1194 return $array; 1195 } 1196 1197 /** 1178 1198 * Return basename of the current script 1179 1199 * Lower case convertion is applied on return value
Note: See TracChangeset
for help on using the changeset viewer.