Changeset 4265 for trunk/install


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

Location:
trunk/install
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • 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))
Note: See TracChangeset for help on using the changeset viewer.