Ignore:
Timestamp:
Nov 15, 2009, 1:26:09 PM (14 years ago)
Author:
nikrou
Message:

Feature 1241 resolved. replace mysql_fetch_array by mysql_fetch_assoc for small php code improvements

File:
1 edited

Legend:

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

    r3747 r4265  
    5959'.(is_numeric($user_id) ? 'and '.$conf['user_fields']['id'].' != \''.$user_id.'\'' : '').'
    6060;';
    61     list($count) = mysql_fetch_array(pwg_query($query));
     61    list($count) = mysql_fetch_row(pwg_query($query));
    6262    if ($count != 0)
    6363    {
     
    111111  FROM '.USERS_TABLE.'
    112112;';
    113     list($next_id) = mysql_fetch_array(pwg_query($query));
     113    list($next_id) = mysql_fetch_row(pwg_query($query));
    114114
    115115    $insert =
     
    135135
    136136      $inserts = array();
    137       while ($row = mysql_fetch_array($result))
     137      while ($row = mysql_fetch_assoc($result))
    138138      {
    139139        array_push
     
    250250  WHERE '.$conf['user_fields']['id'].' = \''.$user_id.'\'';
    251251
    252   $row = mysql_fetch_array(pwg_query($query));
     252  $row = mysql_fetch_assoc(pwg_query($query));
    253253
    254254  while (true)
     
    270270  }
    271271
    272   $row = array_merge($row, mysql_fetch_array($result));
     272  $row = array_merge($row, mysql_fetch_assoc($result));
    273273
    274274  foreach ($row as $key => $value)
     
    325325  WHERE category_id NOT IN ('.$userdata['forbidden_categories'].')
    326326    AND image_id '.$userdata['image_access_type'].' ('.$userdata['image_access_list'].')';
    327       list($userdata['nb_total_images']) = mysql_fetch_array(pwg_query($query));
     327      list($userdata['nb_total_images']) = mysql_fetch_row(pwg_query($query));
    328328
    329329
     
    429429  $result = pwg_query($query);
    430430  $authorizeds = array();
    431   while ($row = mysql_fetch_array($result))
     431  while ($row = mysql_fetch_assoc($result))
    432432  {
    433433    array_push($authorizeds, $row['image_id']);
     
    441441  $result = pwg_query($query);
    442442  $favorites = array();
    443   while ($row = mysql_fetch_array($result))
     443  while ($row = mysql_fetch_assoc($result))
    444444  {
    445445    array_push($favorites, $row['image_id']);
     
    482482;';
    483483  $result = pwg_query($query);
    484   while ($row = mysql_fetch_array($result))
     484  while ($row = mysql_fetch_assoc($result))
    485485  {
    486486    array_push($private_array, $row['id']);
     
    524524;';
    525525    $result = pwg_query($query);
    526     while ($row = mysql_fetch_array($result))
     526    while ($row = mysql_fetch_assoc($result))
    527527    {
    528528      array_push($forbidden_array, $row['id']);
Note: See TracChangeset for help on using the changeset viewer.