Changeset 4325 for trunk/include/ws_functions.inc.php
- Timestamp:
- Nov 20, 2009, 3:17:04 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/ws_functions.inc.php
r4304 r4325 257 257 $result = pwg_query($query); 258 258 $cats = array(); 259 while ($row = mysql_fetch_assoc($result))259 while ($row = pwg_db_fetch_assoc($result)) 260 260 { 261 261 $row['id'] = (int)$row['id']; … … 296 296 297 297 $result = pwg_query($query); 298 while ($row = mysql_fetch_assoc($result))298 while ($row = pwg_db_fetch_assoc($result)) 299 299 { 300 300 $image = array(); … … 406 406 407 407 $cats = array(); 408 while ($row = mysql_fetch_assoc($result))408 while ($row = pwg_db_fetch_assoc($result)) 409 409 { 410 410 $row['url'] = make_index_url( … … 472 472 $cats = array(); 473 473 474 while ($row = mysql_fetch_assoc($result))474 while ($row = pwg_db_fetch_assoc($result)) 475 475 { 476 476 $id = $row['id']; … … 518 518 ' AND' 519 519 ); 520 if ( ! mysql_num_rows( pwg_query( $query ) ) )520 if ( !pwg_db_num_rows( pwg_query( $query ) ) ) 521 521 { 522 522 return new PwgError(WS_ERR_INVALID_PARAM, "Invalid image_id"); … … 578 578 LIMIT 1'; 579 579 580 $image_row = mysql_fetch_assoc(pwg_query($query));580 $image_row = pwg_db_fetch_assoc(pwg_query($query)); 581 581 if ($image_row==null) 582 582 { … … 599 599 $is_commentable = false; 600 600 $related_categories = array(); 601 while ($row = mysql_fetch_assoc($result))601 while ($row = pwg_db_fetch_assoc($result)) 602 602 { 603 603 if ($row['commentable']=='true') … … 656 656 WHERE element_id = '.$image_row['id'].' 657 657 ;'; 658 $rating = mysql_fetch_assoc(pwg_query($query));658 $rating = pwg_db_fetch_assoc(pwg_query($query)); 659 659 $rating['count'] = (int)$rating['count']; 660 660 … … 687 687 688 688 $result = pwg_query($query); 689 while ($row = mysql_fetch_assoc($result))689 while ($row = pwg_db_fetch_assoc($result)) 690 690 { 691 691 $row['id']=(int)$row['id']; … … 758 758 ).' 759 759 LIMIT 1'; 760 if ( mysql_num_rows( pwg_query($query) )==0 )760 if ( pwg_db_num_rows( pwg_query($query) )==0 ) 761 761 { 762 762 return new PwgError(404, "Invalid image_id or access denied" ); … … 814 814 $image_ids = array_flip($image_ids); 815 815 $result = pwg_query($query); 816 while ($row = mysql_fetch_assoc($result))816 while ($row = pwg_db_fetch_assoc($result)) 817 817 { 818 818 $image = array(); … … 871 871 WHERE id IN ('.implode(',',$params['image_id']).')'; 872 872 $result = pwg_query($query); 873 $affected_rows = mysql_affected_rows();873 $affected_rows = pwg_db_affected_rows(); 874 874 if ($affected_rows) 875 875 { … … 1008 1008 WHERE md5sum = \''.$params['original_sum'].'\' 1009 1009 ;'; 1010 list($counter) = mysql_fetch_row(pwg_query($query));1010 list($counter) = pwg_db_fetch_row(pwg_query($query)); 1011 1011 if ($counter != 0) { 1012 1012 return new PwgError(500, 'file already exists'); … … 1014 1014 1015 1015 // current date 1016 list($dbnow) = mysql_fetch_row(pwg_query('SELECT NOW();'));1016 list($dbnow) = pwg_db_fetch_row(pwg_query('SELECT NOW();')); 1017 1017 list($year, $month, $day) = preg_split('/[^\d]/', $dbnow, 4); 1018 1018 … … 1200 1200 ); 1201 1201 1202 $image_id = mysql_insert_id();1202 $image_id = pwg_db_insert_id(); 1203 1203 1204 1204 // let's add links between the image and the categories … … 1359 1359 GROUP BY image_id'; 1360 1360 $result = pwg_query($query); 1361 while ( $row= mysql_fetch_assoc($result) )1361 while ( $row=pwg_db_fetch_assoc($result) ) 1362 1362 { 1363 1363 $row['image_id'] = (int)$row['image_id']; … … 1402 1402 1403 1403 $result = pwg_query($query); 1404 while ($row = mysql_fetch_assoc($result))1404 while ($row = pwg_db_fetch_assoc($result)) 1405 1405 { 1406 1406 $image = array(); … … 1573 1573 ;'; 1574 1574 1575 $image_row = mysql_fetch_assoc(pwg_query($query));1575 $image_row = pwg_db_fetch_assoc(pwg_query($query)); 1576 1576 if ($image_row == null) 1577 1577 {
Note: See TracChangeset
for help on using the changeset viewer.