Changeset 1048 for trunk/admin/include
- Timestamp:
- Feb 20, 2006, 11:14:24 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/admin/include/functions.php
r1042 r1048 1317 1317 function update_average_rate( $element_id=-1 ) 1318 1318 { 1319 $average_rates = array();1320 1321 1319 $query = ' 1322 1320 SELECT element_id, … … 1330 1328 1331 1329 $result = pwg_query($query); 1330 1331 $datas = array(); 1332 1332 1333 while ($row = mysql_fetch_array($result)) 1333 {1334 array_push($average_rates, $row);1335 }1336 1337 $datas = array();1338 foreach ($average_rates as $item)1339 1334 { 1340 1335 array_push( 1341 1336 $datas, 1342 1337 array( 1343 'id' => $ item['element_id'],1344 'average_rate' => $ item['average_rate']1338 'id' => $row['element_id'], 1339 'average_rate' => $row['average_rate'] 1345 1340 ) 1346 1341 ); 1347 1342 } 1348 $fields = array('primary' => array('id'), 'update' => array('average_rate')); 1349 mass_updates(IMAGES_TABLE, $fields, $datas); 1343 1344 mass_updates( 1345 IMAGES_TABLE, 1346 array( 1347 'primary' => array('id'), 1348 'update' => array('average_rate') 1349 ), 1350 $datas 1351 ); 1350 1352 1351 1353 $query='
Note: See TracChangeset
for help on using the changeset viewer.