Changeset 4265


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

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

Location:
trunk
Files:
51 edited

Legend:

Unmodified
Added
Removed
  • trunk/admin/cat_modify.php

    r3282 r4265  
    194194  WHERE id = '.$_GET['cat_id'].'
    195195;';
    196 $category = mysql_fetch_array( pwg_query( $query ) );
     196$category = mysql_fetch_assoc( pwg_query( $query ) );
    197197// nullable fields
    198198foreach (array('comment','dir','site_id', 'id_uppercat') as $nullable)
     
    374374  WHERE id = '.$category['representative_picture_id'].'
    375375;';
    376     $row = mysql_fetch_array(pwg_query($query));
     376    $row = mysql_fetch_assoc(pwg_query($query));
    377377    $src = get_thumbnail_url($row);
    378378    $url = get_root_url().'admin.php?page=picture_modify';
  • trunk/admin/cat_perm.php

    r3282 r4265  
    4646  WHERE id = '.$_GET['cat'].'
    4747;';
    48   list($status) = mysql_fetch_array(pwg_query($query));
     48  list($status) = mysql_fetch_row(pwg_query($query));
    4949 
    5050  if ('private' == $status)
     
    6363;';
    6464
    65   list($page['cat']) = mysql_fetch_array(pwg_query($query));
     65  list($page['cat']) = mysql_fetch_row(pwg_query($query));
    6666}
    6767
     
    111111;';
    112112  $result = pwg_query($query);
    113   while ($row = mysql_fetch_array($result))
     113  while ($row = mysql_fetch_assoc($result))
    114114  {
    115115    array_push($granteds[$row['cat_id']], $row['group_id']);
     
    170170;';
    171171  $result = pwg_query($query);
    172   while ($row = mysql_fetch_array($result))
     172  while ($row = mysql_fetch_assoc($result))
    173173  {
    174174    array_push($granteds[$row['cat_id']], $row['user_id']);
     
    275275';
    276276  $result = pwg_query($query);
    277   while ($row = mysql_fetch_array($result))
     277  while ($row = mysql_fetch_assoc($result))
    278278  {
    279279    if (!isset($granted_groups[$row['group_id']]))
  • trunk/admin/configuration.php

    r3445 r4265  
    139139    //echo '<pre>'; print_r($_POST); echo '</pre>';
    140140    $result = pwg_query('SELECT param FROM '.CONFIG_TABLE);
    141     while ($row = mysql_fetch_array($result))
     141    while ($row = mysql_fetch_assoc($result))
    142142    {
    143143      if (isset($_POST[$row['param']]))
  • trunk/admin/element_set.php

    r3282 r4265  
    193193  $query = 'SELECT MAX(date_available) AS date
    194194  FROM '.IMAGES_TABLE;
    195   if ($row=mysql_fetch_array( pwg_query($query) ) )
     195  if ($row = mysql_fetch_assoc( pwg_query($query) ) )
    196196  {
    197197    $query = 'SELECT id
  • trunk/admin/element_set_global.php

    r3282 r4265  
    246246    $result = pwg_query($query);
    247247
    248     while ($row = mysql_fetch_array($result))
     248    while ($row = mysql_fetch_assoc($result))
    249249    {
    250250      $data = array();
  • trunk/admin/element_set_ranks.php

    r3282 r4265  
    116116  WHERE id = '.$page['category_id'].'
    117117;';
    118 $category = mysql_fetch_array(pwg_query($query));
     118$category = mysql_fetch_assoc(pwg_query($query));
    119119
    120120// Navigation path
  • trunk/admin/element_set_unit.php

    r3282 r4265  
    5757  $result = pwg_query($query);
    5858
    59   while ($row = mysql_fetch_array($result))
     59  while ($row = mysql_fetch_assoc($result))
    6060  {
    6161    $data = array();
  • trunk/admin/group_list.php

    r3282 r4265  
    176176$toggle_is_default_url     = $admin_url.'group_list&amp;toggle_is_default=';
    177177
    178 while ($row = mysql_fetch_array($result))
     178while ($row = mysql_fetch_assoc($result))
    179179{
    180180  $query = '
  • trunk/admin/group_perm.php

    r3282 r4265  
    8080;';
    8181  $result = pwg_query($query);
    82   while ($row = mysql_fetch_array($result))
     82  while ($row = mysql_fetch_assoc($result))
    8383  {
    8484    array_push($private_uppercats, $row['id']);
     
    9797  $result = pwg_query($query);
    9898
    99   while ($row = mysql_fetch_array($result))
     99  while ($row = mysql_fetch_assoc($result))
    100100  {
    101101    array_push($authorized_ids, $row['cat_id']);
     
    158158$result = pwg_query($query_true);
    159159$authorized_ids = array();
    160 while ($row = mysql_fetch_array($result))
     160while ($row = mysql_fetch_assoc($result))
    161161{
    162162  array_push($authorized_ids, $row['id']);
  • trunk/admin/history.php

    r3282 r4265  
    258258
    259259    $username_of = array();
    260     while ($row = mysql_fetch_array($result))
     260    while ($row = mysql_fetch_assoc($result))
    261261    {
    262262      $username_of[$row['id']] = $row['username'];
     
    306306
    307307    $result = pwg_query($query);
    308     while ($row = mysql_fetch_array($result))
     308    while ($row = mysql_fetch_assoc($result))
    309309    {
    310310      $label_of_image[ $row['id'] ] = $row['label'];
     
    342342
    343343    $result = pwg_query($query);
    344     while ($row = mysql_fetch_array($result))
     344    while ($row = mysql_fetch_assoc($result))
    345345    {
    346346      $name_of_tag[ $row['id'] ] = $row['name'];
  • trunk/admin/include/c13y_internal.class.php

    r3282 r4265  
    127127
    128128    $result = pwg_query($query);
    129     while ($row = mysql_fetch_array($result))
     129    while ($row = mysql_fetch_assoc($result))
    130130    {
    131131      $status[$row['id']] = $row['status'];
  • trunk/admin/include/functions.php

    r3657 r4265  
    3737  $result = pwg_query($query);
    3838  $category_ids = array();
    39   while ($row = mysql_fetch_array($result))
     39  while ($row = mysql_fetch_assoc($result))
    4040  {
    4141    array_push($category_ids, $row['id']);
     
    7878  $result = pwg_query($query);
    7979  $element_ids = array();
    80   while ($row = mysql_fetch_array($result))
     80  while ($row = mysql_fetch_assoc($result))
    8181  {
    8282    array_push($element_ids, $row['id']);
     
    545545    $columns = array();
    546546    $all_fields = array_merge($dbfields['primary'], $dbfields['update']);
    547     while ($row = mysql_fetch_array($result))
     547    while ($row = mysql_fetch_assoc($result))
    548548    {
    549549      if (in_array($row['Field'], $all_fields))
     
    631631
    632632  $result = pwg_query($query);
    633   while ($row = mysql_fetch_array($result))
     633  while ($row = mysql_fetch_assoc($result))
    634634  {
    635635    if ($row['id_uppercat'] != $current_uppercat)
     
    777777;';
    778778  $result = pwg_query($query);
    779   while ($row = mysql_fetch_array($result))
     779  while ($row = mysql_fetch_assoc($result))
    780780  {
    781781    $uppercats = array_merge($uppercats,
     
    804804  LIMIT 0,1
    805805;';
    806     list($representative) = mysql_fetch_array(pwg_query($query));
     806    list($representative) = mysql_fetch_row(pwg_query($query));
    807807
    808808    array_push(
     
    864864;';
    865865  $result = pwg_query($query);
    866   while ($row = mysql_fetch_array($result))
     866  while ($row = mysql_fetch_assoc($result))
    867867  {
    868868    array_push($categories, $row);
     
    11401140  $datas = array();
    11411141
    1142   while ($row = mysql_fetch_array($result))
     1142  while ($row = mysql_fetch_assoc($result))
    11431143  {
    11441144    array_push(
     
    12071207;';
    12081208  $result = pwg_query($query);
    1209   while ($row = mysql_fetch_array($result))
     1209  while ($row = mysql_fetch_assoc($result))
    12101210  {
    12111211    $categories[$row['id']] =
     
    13561356  WHERE id_uppercat '.(is_numeric($parent_id) ? '= '.$parent_id : 'IS NULL').'
    13571357;';
    1358   list($current_rank) = mysql_fetch_array(pwg_query($query));
     1358  list($current_rank) = mysql_fetch_row(pwg_query($query));
    13591359
    13601360  $insert = array(
     
    13721372  WHERE id = '.$parent_id.'
    13731373;';
    1374     $parent = mysql_fetch_array(pwg_query($query));
    1375 
    1376     $insert{'id_uppercat'} = $parent{'id'};
    1377     $insert{'global_rank'} = $parent{'global_rank'}.'.'.$insert{'rank'};
     1374    $parent = mysql_fetch_assoc(pwg_query($query));
     1375
     1376    $insert['id_uppercat'] = $parent['id'];
     1377    $insert['global_rank'] = $parent['global_rank'].'.'.$insert['rank'];
    13781378
    13791379    // at creation, must a category be visible or not ? Warning : if the
     
    13821382    if ('false' == $parent['visible'])
    13831383    {
    1384       $insert{'visible'} = 'false';
     1384      $insert['visible'] = 'false';
    13851385    }
    13861386    else
    13871387    {
    1388       $insert{'visible'} = boolean_to_string($conf['newcat_default_visible']);
     1388      $insert['visible'] = boolean_to_string($conf['newcat_default_visible']);
    13891389    }
    13901390
     
    13941394    if ('private' == $parent['status'])
    13951395    {
    1396       $insert{'status'} = 'private';
     1396      $insert['status'] = 'private';
    13971397    }
    13981398    else
    13991399    {
    1400       $insert{'status'} = $conf['newcat_default_status'];
     1400      $insert['status'] = $conf['newcat_default_status'];
    14011401    }
    14021402  }
    14031403  else
    14041404  {
    1405     $insert{'visible'} = boolean_to_string($conf['newcat_default_visible']);
    1406     $insert{'status'} = $conf['newcat_default_status'];
    1407     $insert{'global_rank'} = $insert{'rank'};
     1405    $insert['visible'] = boolean_to_string($conf['newcat_default_visible']);
     1406    $insert['status'] = $conf['newcat_default_status'];
     1407    $insert['global_rank'] = $insert['rank'];
    14081408  }
    14091409
     
    16101610  $query = 'SHOW TABLES LIKE \''.$prefixeTable.'%\'';
    16111611  $result = pwg_query($query);
    1612   while ($row = mysql_fetch_array($result))
     1612  while ($row = mysql_fetch_assoc($result))
    16131613  {
    16141614    array_push($all_tables, $row[0]);
     
    16261626    $query = 'DESC '.$table_name.';';
    16271627    $result = pwg_query($query);
    1628     while ($row = mysql_fetch_array($result))
     1628    while ($row = mysql_fetch_assoc($result))
    16291629    {
    16301630      if ($row['Key'] == 'PRI')
  • trunk/admin/include/functions_metadata.php

    r3282 r4265  
    260260;';
    261261  $result = pwg_query($query);
    262   while ($row = mysql_fetch_array($result))
     262  while ($row = mysql_fetch_assoc($result))
    263263  {
    264264    array_push($cat_ids, $row['id']);
     
    285285;';
    286286  $result = pwg_query($query);
    287   while ($row = mysql_fetch_array($result))
     287  while ($row = mysql_fetch_assoc($result))
    288288  {
    289289    $files[$row['id']] = $row['path'];
  • trunk/admin/include/functions_notification_by_mail.inc.php

    r3282 r4265  
    168168    if (!empty($result))
    169169    {
    170       while ($nbm_user = mysql_fetch_array($result))
     170      while ($nbm_user = mysql_fetch_assoc($result))
    171171      {
    172172        array_push($data_users, $nbm_user);
  • trunk/admin/include/functions_permalinks.php

    r3282 r4265  
    5353  $cat_id = null;
    5454  if ( mysql_num_rows($result) )
    55     list( $cat_id ) = mysql_fetch_array($result);
     55    list( $cat_id ) = mysql_fetch_row($result);
    5656  return $cat_id;
    5757}
     
    7575  if ( mysql_num_rows($result) )
    7676  {
    77     list($permalink) = mysql_fetch_array($result);
     77    list($permalink) = mysql_fetch_row($result);
    7878  }
    7979  if ( !isset($permalink) )
  • trunk/admin/notification_by_mail.php

    r3282 r4265  
    151151    $check_key_list = array();
    152152
    153     while ($nbm_user = mysql_fetch_array($result))
     153    while ($nbm_user = mysql_fetch_assoc($result))
    154154    {
    155155      // Calculate key
     
    513513      // Update param
    514514      $result = pwg_query('select param, value from '.CONFIG_TABLE.' where param like \'nbm\\_%\'');
    515       while ($nbm_user = mysql_fetch_array($result))
     515      while ($nbm_user = mysql_fetch_assoc($result))
    516516      {
    517517        if (isset($_POST[$nbm_user['param']]))
  • trunk/admin/picture_modify.php

    r3390 r4265  
    176176  WHERE id = '.$_GET['image_id'].'
    177177;';
    178 $row = mysql_fetch_array(pwg_query($query));
     178$row = mysql_fetch_assoc(pwg_query($query));
    179179
    180180$storage_category_id = null;
     
    325325$result = pwg_query($query);
    326326
    327 while ($row = mysql_fetch_array($result))
     327while ($row = mysql_fetch_assoc($result))
    328328{
    329329  $name =
     
    418418  array_push($associateds, $storage_category_id);
    419419}
    420 while ($row = mysql_fetch_array($result))
     420while ($row = mysql_fetch_assoc($result))
    421421{
    422422  array_push($associateds, $row['id']);
  • trunk/admin/rating.php

    r3282 r4265  
    9595;';
    9696$result = pwg_query($query);
    97 while ($row = mysql_fetch_array($result))
     97while ($row = mysql_fetch_assoc($result))
    9898{
    9999  $users[$row['id']]=$row['username'];
     
    215215   );
    216216
    217   while ($row = mysql_fetch_array($result))
     217  while ($row = mysql_fetch_assoc($result))
    218218  {
    219219
  • trunk/admin/site_manager.php

    r3282 r4265  
    9999  WHERE galleries_url = \''.$url.'\'
    100100;';
    101   $row = mysql_fetch_array(pwg_query($query));
     101  $row = mysql_fetch_assoc(pwg_query($query));
    102102  if ($row['count'] > 0)
    103103  {
     
    168168  WHERE id = '.$page['site'].'
    169169;';
    170   list($galleries_url) = mysql_fetch_array(pwg_query($query));
     170  list($galleries_url) = mysql_fetch_row(pwg_query($query));
    171171  switch($_GET['action'])
    172172  {
     
    237237$result = pwg_query($query);
    238238
    239 while ($row = mysql_fetch_array($result))
     239while ($row = mysql_fetch_assoc($result))
    240240{
    241241  $is_remote = url_is_remote($row['galleries_url']);
  • trunk/admin/site_update.php

    r3282 r4265  
    186186  FROM '.CATEGORIES_TABLE;
    187187  $result = pwg_query($query);
    188   while ($row = mysql_fetch_array($result))
     188  while ($row = mysql_fetch_assoc($result))
    189189  {
    190190    $next_rank[$row['id']] = 1;
     
    197197  GROUP BY id_uppercat';
    198198  $result = pwg_query($query);
    199   while ($row = mysql_fetch_array($result))
     199  while ($row = mysql_fetch_assoc($result))
    200200  {
    201201    // for the id_uppercat NULL, we write 'NULL' and not the empty string
     
    211211SELECT IF(MAX(id)+1 IS NULL, 1, MAX(id)+1) AS next_id
    212212  FROM '.CATEGORIES_TABLE;
    213   list($next_id) = mysql_fetch_array(pwg_query($query));
     213  list($next_id) = mysql_fetch_row(pwg_query($query));
    214214
    215215  // retrieve sub-directories fulldirs from the site reader
     
    387387    AND validated = \'false\'';
    388388    $result = pwg_query($query);
    389     while ($row = mysql_fetch_array($result))
     389    while ($row = mysql_fetch_assoc($result))
    390390    {
    391391      array_push(
     
    403403SELECT IF(MAX(id)+1 IS NULL, 1, MAX(id)+1) AS next_element_id
    404404  FROM '.IMAGES_TABLE;
    405   list($next_element_id) = mysql_fetch_array(pwg_query($query));
     405  list($next_element_id) = mysql_fetch_row(pwg_query($query));
    406406
    407407  $start = get_moment();
     
    556556    $waiting_to_delete = array();
    557557
    558     while ($row = mysql_fetch_array($result))
     558    while ($row = mysql_fetch_assoc($result))
    559559    {
    560560      $data = array();
     
    565565  WHERE storage_category_id = '.$row['storage_category_id'].'
    566566    AND file = \''.$row['file'].'\'';
    567       list($data['id']) = mysql_fetch_array(pwg_query($query));
     567      list($data['id']) = mysql_fetch_row(pwg_query($query));
    568568
    569569      foreach ($fields['update'] as $field)
  • trunk/admin/stats.php

    r3282 r4265  
    9696
    9797  $output = array();
    98   while ($row = mysql_fetch_array($result))
     98  while ($row = mysql_fetch_assoc($result))
    9999  {
    100100    array_push($output, $row);
     
    134134$first_time_key = null;
    135135
    136 while ($row = mysql_fetch_array($result))
     136while ($row = mysql_fetch_assoc($result))
    137137{
    138138  $time_keys = array(
  • trunk/admin/tags.php

    r3282 r4265  
    5050;';
    5151  $result = pwg_query($query);
    52   while ($row = mysql_fetch_array($result))
     52  while ($row = mysql_fetch_assoc($result))
    5353  {
    5454    $current_name_of[ $row['id'] ] = $row['name'];
     
    221221;';
    222222  $result = pwg_query($query);
    223   while ($row = mysql_fetch_array($result))
     223  while ($row = mysql_fetch_assoc($result))
    224224  {
    225225    $name_of[ $row['id'] ] = $row['name'];
  • trunk/admin/upload.php

    r3720 r4265  
    101101;';
    102102    $result = pwg_query($query);
    103     while($row = mysql_fetch_array($result))
     103    while($row = mysql_fetch_assoc($result))
    104104    {
    105105      $dir = get_complete_dir($row['storage_category_id']);
     
    154154$query.= ';';
    155155$result = pwg_query( $query );
    156 while ( $row = mysql_fetch_array( $result ) )
     156while ( $row = mysql_fetch_assoc( $result ) )
    157157{
    158158  if ( !isset( $cat_names[$row['storage_category_id']] ) )
  • trunk/admin/user_list.php

    r4068 r4265  
    116116
    117117  $result = pwg_query($query);
    118   while ($row = mysql_fetch_array($result))
     118  while ($row = mysql_fetch_assoc($result))
    119119  {
    120120    $user = $row;
     
    140140;';
    141141    $result = pwg_query($query);
    142     while ($row = mysql_fetch_array($result))
     142    while ($row = mysql_fetch_assoc($result))
    143143    {
    144144      array_push(
     
    493493$result = pwg_query($query);
    494494
    495 while ($row = mysql_fetch_array($result))
     495while ($row = mysql_fetch_assoc($result))
    496496{
    497497  $groups[$row['id']] = $row['name'];
  • trunk/admin/user_perm.php

    r3282 r4265  
    7979;';
    8080  $result = pwg_query($query);
    81   while ($row = mysql_fetch_array($result))
     81  while ($row = mysql_fetch_assoc($result))
    8282  {
    8383    array_push($private_uppercats, $row['id']);
     
    9696  $result = pwg_query($query);
    9797
    98   while ($row = mysql_fetch_array($result))
     98  while ($row = mysql_fetch_assoc($result))
    9999  {
    100100    array_push($authorized_ids, $row['cat_id']);
     
    159159{
    160160  $cats = array();
    161   while ($row = mysql_fetch_array($result))
     161  while ($row = mysql_fetch_assoc($result))
    162162  {
    163163    array_push($cats, $row);
     
    192192$result = pwg_query($query_true);
    193193$authorized_ids = array();
    194 while ($row = mysql_fetch_array($result))
     194while ($row = mysql_fetch_assoc($result))
    195195{
    196196  array_push($authorized_ids, $row['id']);
  • trunk/include/calendar_monthly.class.php

    r3282 r4265  
    232232  $result = pwg_query($query);
    233233  $items=array();
    234   while ($row = mysql_fetch_array($result))
     234  while ($row = mysql_fetch_assoc($result))
    235235  {
    236236    $y = substr($row['period'], 0, 4);
     
    284284  $result = pwg_query($query);
    285285  $items=array();
    286   while ($row = mysql_fetch_array($result))
     286  while ($row = mysql_fetch_assoc($result))
    287287  {
    288288    $m = (int)substr($row['period'], 0, 2);
     
    334334  $items=array();
    335335  $result = pwg_query($query);
    336   while ($row = mysql_fetch_array($result))
     336  while ($row = mysql_fetch_assoc($result))
    337337  {
    338338    $d = (int)$row['period'];
  • trunk/include/category_cats.inc.php

    r3282 r4265  
    179179;';
    180180    $result = pwg_query($query);
    181     while ($row = mysql_fetch_array($result))
     181    while ($row = mysql_fetch_assoc($result))
    182182    {
    183183      $dates_of_category[ $row['category_id'] ] = array(
  • trunk/include/functions.inc.php

    r3750 r4265  
    4545  // columns are 'Field', 'Type'
    4646  $result = pwg_query('desc '.$table);
    47   while ($row = mysql_fetch_array($result))
     47  while ($row = mysql_fetch_assoc($result))
    4848  {
    4949    // we are only interested in the the field given in parameter for the
     
    936936
    937937  $result = pwg_query($query);
    938   while ($row = mysql_fetch_array($result))
     938  while ($row = mysql_fetch_assoc($result))
    939939  {
    940940    array_push($array, $row[$fieldname]);
     
    11221122  WHERE '.$conf['user_fields']['id'].' = '.$conf['webmaster_id'].'
    11231123;';
    1124   list($email) = mysql_fetch_array(pwg_query($query));
     1124  list($email) = mysql_fetch_row(pwg_query($query));
    11251125
    11261126  return $email;
     
    11481148  }
    11491149
    1150   while ($row = mysql_fetch_array($result))
     1150  while ($row = mysql_fetch_assoc($result))
    11511151  {
    11521152    $conf[ $row['param'] ] = isset($row['value']) ? $row['value'] : '';
     
    11931193
    11941194  $result = pwg_query($query);
    1195   while ($row = mysql_fetch_array($result))
     1195  while ($row = mysql_fetch_assoc($result))
    11961196  {
    11971197    $array[ $row[$keyname] ] = $row[$valuename];
     
    15851585    // Use MySql date in order to standardize all recent "actions/queries"
    15861586    list($cache['get_icon']['sql_recent_date']) =
    1587       mysql_fetch_array(pwg_query('select SUBDATE(
     1587      mysql_fetch_row(pwg_query('select SUBDATE(
    15881588      CURRENT_DATE,INTERVAL '.$user['recent_period'].' DAY)'));
    15891589  }
  • trunk/include/functions_category.inc.php

    r3282 r4265  
    241241    $query.= ' FROM '.CATEGORIES_TABLE.' WHERE id = '.$category_id;
    242242    $query.= ';';
    243     $row = mysql_fetch_array( pwg_query( $query ) );
     243    $row = mysql_fetch_assoc( pwg_query( $query ) );
    244244    $uppercats = $row['uppercats'];
    245245  }
     
    252252  $query.= ';';
    253253  $result = pwg_query( $query );
    254   while( $row = mysql_fetch_array( $result ) )
     254  while( $row = mysql_fetch_assoc( $result ) )
    255255  {
    256256    $database_dirs[$row['id']] = $row['dir'];
     
    276276    AND c.id = '.$category_id.'
    277277;';
    278   $row = mysql_fetch_array(pwg_query($query));
     278  $row = mysql_fetch_assoc(pwg_query($query));
    279279  return $row['galleries_url'];
    280280}
     
    385385
    386386  $subcats = array();
    387   while ($row = mysql_fetch_array($result))
     387  while ($row = mysql_fetch_assoc($result))
    388388  {
    389389    array_push($subcats, $row['id']);
  • trunk/include/functions_mail.inc.php

    r3938 r4265  
    352352  if (!empty($datas))
    353353  {
    354     while ($admin = mysql_fetch_array($datas))
     354    while ($admin = mysql_fetch_assoc($datas))
    355355    {
    356356      if (!empty($admin['mail_address']))
     
    451451  {
    452452    $list = array();
    453     while ($row = mysql_fetch_array($result))
     453    while ($row = mysql_fetch_assoc($result))
    454454    {
    455455      $row['template_theme'] = $row['template'];
     
    480480      {
    481481        $Bcc = array();
    482         while ($row = mysql_fetch_array($result))
     482        while ($row = mysql_fetch_assoc($result))
    483483        {
    484484          if (!empty($row['mail_address']))
  • trunk/include/functions_notification.inc.php

    r3282 r4265  
    146146    $query = 'SELECT count(distinct '.$field_id.') as CountId
    147147'.$query;
    148     list($count) = mysql_fetch_array(pwg_query($query));
     148    list($count) = mysql_fetch_row(pwg_query($query));
    149149    return $count;
    150150
     
    179179    $infos = array();
    180180
    181     while ($row = mysql_fetch_array($result))
     181    while ($row = mysql_fetch_assoc($result))
    182182    {
    183183      array_push($infos, $row);
  • trunk/include/functions_plugins.inc.php

    r3282 r4265  
    239239  $result = pwg_query($query);
    240240  $plugins = array();
    241   while ($row = mysql_fetch_array($result))
     241  while ($row = mysql_fetch_assoc($result))
    242242  {
    243243    array_push($plugins, $row);
  • trunk/include/functions_search.inc.php

    r4261 r4265  
    459459  $by_weights=array();
    460460  $result = pwg_query($query);
    461   while ($row = mysql_fetch_array($result))
     461  while ($row = mysql_fetch_assoc($result))
    462462  { // weight is important when sorting images by relevance
    463463    if ($row['weight'])
  • 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']);
  • trunk/include/picture_comment.inc.php

    r3488 r4265  
    9494  FROM '.COMMENTS_TABLE.'
    9595  WHERE image_id='.$page['image_id']." AND validated = 'true'";
    96   $row = mysql_fetch_array( pwg_query( $query ) );
     96  $row = mysql_fetch_assoc( pwg_query( $query ) );
    9797
    9898  // navigation bar creation
     
    141141    $result = pwg_query( $query );
    142142
    143     while ($row = mysql_fetch_array($result))
     143    while ($row = mysql_fetch_assoc($result))
    144144    {
    145145      if (!empty($row['author']))
  • trunk/include/picture_rate.inc.php

    r3282 r4265  
    3838  WHERE element_id = '.$picture['current']['id'].'
    3939;';
    40     $row = mysql_fetch_array(pwg_query($query));
     40    $row = mysql_fetch_assoc(pwg_query($query));
    4141  }
    4242  else
     
    7070      if (mysql_num_rows($result) > 0)
    7171      {
    72         $row = mysql_fetch_array($result);
     72        $row = mysql_fetch_assoc($result);
    7373        $user_rate = $row['rate'];
    7474      }
  • trunk/install/db/12-database.php

    r3282 r4265  
    6767$datas = array();
    6868
    69 while ($row = mysql_fetch_array($result))
     69while ($row = mysql_fetch_assoc($result))
    7070{
    7171  array_push(
  • trunk/install/db/18-database.php

    r3282 r4265  
    4848$datas = array();
    4949
    50 while ($row = mysql_fetch_array($result))
     50while ($row = mysql_fetch_assoc($result))
    5151{
    5252  array_push(
  • trunk/install/db/19-database.php

    r3282 r4265  
    6969;';
    7070$result = pwg_query($query);
    71 while ($row = mysql_fetch_array($result))
     71while ($row = mysql_fetch_assoc($result))
    7272{
    7373  foreach(preg_split('/[,]+/', $row['keywords']) as $keyword)
  • trunk/install/db/20-database.php

    r3282 r4265  
    4848
    4949$datas = array();
    50 while ($row = mysql_fetch_array($result))
     50while ($row = mysql_fetch_assoc($result))
    5151{
    5252  array_push(
  • trunk/install/db/65-database.php

    r3282 r4265  
    166166  $query = 'SHOW TABLES LIKE "'.$prefixeTable.'%"';
    167167  $result = pwg_query($query);
    168   while ( $row=mysql_fetch_array($result) )
     168  while ( $row=mysql_fetch_assoc($result) )
    169169  {
    170170    array_push($all_tables, $row[0]);
     
    177177    $result = pwg_query($query);
    178178    $field_definitions=array();
    179     while ( $row=mysql_fetch_array($result) )
     179    while ( $row=mysql_fetch_assoc($result) )
    180180    {
    181181      if ( !isset($row['Collation']) or $row['Collation']=='NULL' )
  • trunk/install/db/8-database.php

    r3282 r4265  
    6161$query = 'SELECT param FROM '.PREFIX_TABLE.'config';
    6262$result = pwg_query($query);
    63 while ($row = mysql_fetch_array($result))
     63while ($row = mysql_fetch_assoc($result))
    6464{
    6565  unset( $params[ $row['param'] ] );
  • trunk/install/db/9-database.php

    r3282 r4265  
    4848$datas = array();
    4949
    50 while ($row = mysql_fetch_array($result))
     50while ($row = mysql_fetch_assoc($result))
    5151{
    5252  array_push(
  • trunk/install/upgrade_1.3.0.php

    r3282 r4265  
    8585;';
    8686$result = pwg_query($query);
    87 while ($row = mysql_fetch_array($result))
     87while ($row = mysql_fetch_assoc($result))
    8888{
    8989  if (!isset($row['id_uppercat']) or $row['id_uppercat'] == '')
  • trunk/install/upgrade_1.3.1.php

    r3282 r4265  
    4343  FROM '.PREFIX_TABLE.'config
    4444;';
    45 $save = mysql_fetch_array(pwg_query($query));
     45$save = mysql_fetch_assoc(pwg_query($query));
    4646
    4747$queries = array(
     
    345345;';
    346346  $result = pwg_query($query);
    347   while ($row = mysql_fetch_array($result))
     347  while ($row = mysql_fetch_assoc($result))
    348348  {
    349349    if ($row['Key_name'] != 'PRIMARY')
     
    537537;';
    538538$result = pwg_query($query);
    539 while ($row = mysql_fetch_array($result))
     539while ($row = mysql_fetch_assoc($result))
    540540{
    541541  array_push($cat_ids, $row['unique_storage_category_id']);
     
    562562;';
    563563$result = pwg_query($query);
    564 while ($row = mysql_fetch_array($result))
     564while ($row = mysql_fetch_assoc($result))
    565565{
    566566  array_push($cat_ids, $row['id']);
  • trunk/install/upgrade_1.4.0.php

    r3282 r4265  
    4343  WHERE param = \'prefix_thumbnail\'
    4444;';
    45 list($prefix_thumbnail) = mysql_fetch_array(pwg_query($query));
     45list($prefix_thumbnail) = mysql_fetch_row(pwg_query($query));
    4646
    4747// delete obsolete configuration
     
    195195
    196196$result = pwg_query($query);
    197 while ($row = mysql_fetch_array($result))
     197while ($row = mysql_fetch_assoc($result))
    198198{
    199199  $row['user_id'] = $row['id'];
  • trunk/install/upgrade_1.5.0.php

    r3282 r4265  
    8080;';
    8181  $result = pwg_query($query);
    82   while ($row = mysql_fetch_array($result))
     82  while ($row = mysql_fetch_assoc($result))
    8383  {
    8484    foreach(preg_split('/[,]+/', $row['keywords']) as $keyword)
     
    352352$query = 'SELECT param FROM '.PREFIX_TABLE.'config';
    353353$result = pwg_query($query);
    354 while ($row = mysql_fetch_array($result))
     354while ($row = mysql_fetch_assoc($result))
    355355{
    356356  unset( $params[ $row['param'] ] );
     
    453453$result = pwg_query($query);
    454454
    455 while ($row = mysql_fetch_array($result))
     455while ($row = mysql_fetch_assoc($result))
    456456{
    457457  if (!in_array($row['Field'], $to_keep))
  • trunk/password.php

    r3282 r4265  
    8080      $datas = array();
    8181     
    82       while ($row = mysql_fetch_array($result))
     82      while ($row = mysql_fetch_assoc($result))
    8383      {
    8484        $new_password = generate_key(6);
  • trunk/picture.php

    r3445 r4265  
    5858      '.%" ESCAPE "/" LIMIT 1';
    5959  }
    60   if ( ! ( $row = mysql_fetch_array(pwg_query($query)) ) )
     60  if ( ! ( $row = mysql_fetch_assoc(pwg_query($query)) ) )
    6161  {// element does not exist
    6262    page_not_found( 'The requested image does not exist',
     
    388388$result = pwg_query($query);
    389389$related_categories = array();
    390 while ($row = mysql_fetch_array($result))
     390while ($row = mysql_fetch_assoc($result))
    391391{
    392392  array_push($related_categories, $row);
     
    768768;';
    769769  $result = pwg_query($query);
    770   $row = mysql_fetch_array($result);
     770  $row = mysql_fetch_assoc($result);
    771771
    772772  if ($row['nb_fav'] == 0)
  • trunk/search_rules.php

    r3282 r4265  
    136136  if (!empty($result))
    137137  {
    138     while ($row = mysql_fetch_array($result))
     138    while ($row = mysql_fetch_assoc($result))
    139139    {
    140140      array_push($categories, $row);
  • trunk/upload.php

    r3747 r4265  
    289289  $query.= ';';
    290290  $result= pwg_query( $query );
    291   $row = mysql_fetch_array( $result );
     291  $row = mysql_fetch_assoc( $result );
    292292  $file = substr ( $row['file'], 0, strrpos ( $row['file'], ".") );
    293293  $extension = get_extension( $_FILES['picture']['name'] );
Note: See TracChangeset for help on using the changeset viewer.