Ignore:
Timestamp:
Oct 30, 2004, 5:42:29 PM (20 years ago)
Author:
z0rglub
Message:
  • function mysql_query replaced by pwg_query : the same with debugging features
  • by default, DEBUG is set to 0 (off)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/admin/include/functions.php

    r563 r587  
    168168  WHERE site_id = '.$id.'
    169169;';
    170   $result = mysql_query($query);
     170  $result = pwg_query($query);
    171171  $category_ids = array();
    172172  while ($row = mysql_fetch_array($result))
     
    181181  WHERE id = '.$id.'
    182182;';
    183   mysql_query($query);
     183  pwg_query($query);
    184184}
    185185       
     
    206206  WHERE storage_category_id IN ('.implode(',', $ids).')
    207207;';
    208   $result = mysql_query($query);
     208  $result = pwg_query($query);
    209209  $element_ids = array();
    210210  while ($row = mysql_fetch_array($result))
     
    219219  WHERE category_id IN ('.implode(',', $ids).')
    220220;';
    221   mysql_query($query);
     221  pwg_query($query);
    222222
    223223  // destruction of the access linked to the category
     
    226226  WHERE cat_id IN ('.implode(',', $ids).')
    227227;';
    228   mysql_query($query);
     228  pwg_query($query);
    229229  $query = '
    230230DELETE FROM '.GROUP_ACCESS_TABLE.'
    231231  WHERE cat_id IN ('.implode(',', $ids).')
    232232;';
    233   mysql_query($query);
     233  pwg_query($query);
    234234
    235235  // destruction of the sub-categories
     
    239239  WHERE id_uppercat IN ('.implode(',', $ids).')
    240240;';
    241   $result = mysql_query($query);
     241  $result = pwg_query($query);
    242242  $subcat_ids = array();
    243243  while($row = mysql_fetch_array($result))
     
    255255  WHERE id IN ('.implode(',', $ids).')
    256256;';
    257   mysql_query($query);
     257  pwg_query($query);
    258258
    259259  if (isset($counts['del_categories']))
     
    283283'.wordwrap(implode(', ', $ids), 80, "\n").')
    284284;';
    285   mysql_query($query);
     285  pwg_query($query);
    286286
    287287  // destruction of the links between images and this category
     
    291291'.wordwrap(implode(', ', $ids), 80, "\n").')
    292292;';
    293   mysql_query($query);
     293  pwg_query($query);
    294294
    295295  // destruction of the favorites associated with the picture
     
    299299'.wordwrap(implode(', ', $ids), 80, "\n").')
    300300;';
    301   mysql_query($query);
     301  pwg_query($query);
    302302
    303303  // destruction of the rates associated to this element
     
    307307'.wordwrap(implode(', ', $ids), 80, "\n").')
    308308;';
    309   mysql_query($query);
     309  pwg_query($query);
    310310               
    311311  // destruction of the image
     
    315315'.wordwrap(implode(', ', $ids), 80, "\n").')
    316316;';
    317   mysql_query($query);
     317  pwg_query($query);
    318318
    319319  if (isset($counts['del_elements']))
     
    336336  $query.= ' WHERE user_id = '.$user_id;
    337337  $query.= ';';
    338   mysql_query( $query );
     338  pwg_query( $query );
    339339
    340340  // destruction of the group links for this user
     
    342342  $query.= ' WHERE user_id = '.$user_id;
    343343  $query.= ';';
    344   mysql_query( $query );
     344  pwg_query( $query );
    345345
    346346  // destruction of the favorites associated with the user
     
    348348  $query.= ' WHERE user_id = '.$user_id;
    349349  $query.= ';';
    350   mysql_query( $query );
     350  pwg_query( $query );
    351351
    352352  // destruction of the sessions linked with the user
     
    354354  $query.= ' WHERE user_id = '.$user_id;
    355355  $query.= ';';
    356   mysql_query( $query );
     356  pwg_query( $query );
    357357
    358358  // destruction of the user
     
    360360  $query.= ' WHERE id = '.$user_id;
    361361  $query.= ';';
    362   mysql_query( $query );
     362  pwg_query( $query );
    363363}
    364364
     
    373373  $query.= ' WHERE group_id = '.$group_id;
    374374  $query.= ';';
    375   mysql_query( $query );
     375  pwg_query( $query );
    376376
    377377  // synchronize all users linked to the group
     
    382382  $query.= ' WHERE group_id = '.$group_id;
    383383  $query.= ';';
    384   mysql_query( $query );
     384  pwg_query( $query );
    385385
    386386  // destruction of the group
     
    388388  $query.= ' WHERE id = '.$group_id;
    389389  $query.= ';';
    390   mysql_query( $query );
     390  pwg_query( $query );
    391391}
    392392
     
    400400  $query.= ' WHERE id = '.$user_id;
    401401  $query.= ';';
    402   $row = mysql_fetch_array( mysql_query( $query ) );
     402  $row = mysql_fetch_array( pwg_query( $query ) );
    403403  $status = $row['status'];
    404404  // retrieving all the restricted categories for this user
     
    413413  $query.= ' WHERE user_id = '.$user_id;
    414414  $query.= ';';
    415   $result = mysql_query ( $query );
     415  $result = pwg_query ( $query );
    416416  while ( $row = mysql_fetch_array( $result ) )
    417417  {
     
    424424    $query.= ' WHERE image_id = '.$row['image_id'];
    425425    $query.= ';';
    426     $picture_result = mysql_query( $query );
     426    $picture_result = pwg_query( $query );
    427427    $picture_cat = array();
    428428    while ( $picture_row = mysql_fetch_array( $picture_result ) )
     
    436436      $query.= ' AND user_id = '.$user_id;
    437437      $query.= ';';
    438       mysql_query( $query );
     438      pwg_query( $query );
    439439    }
    440440  }
     
    465465  GROUP BY category_id
    466466;';
    467   $result = mysql_query( $query );
     467  $result = pwg_query( $query );
    468468  while ( $row = mysql_fetch_array( $result ) )
    469469  {
     
    475475  WHERE id = '.$row['category_id'].'
    476476;';
    477     mysql_query($query);
     477    pwg_query($query);
    478478  }
    479479
     
    486486    AND id IN ('.implode(',', $cat_ids).')
    487487;';
    488     $result = mysql_query( $query );
     488    $result = pwg_query( $query );
    489489    while ( $row = mysql_fetch_array( $result ) )
    490490    {
     
    495495    AND image_id = '.$row['representative_picture_id'].'
    496496;';
    497       $result = mysql_query( $query );
     497      $result = pwg_query( $query );
    498498      if (mysql_num_rows($result) == 0)
    499499      {
     
    503503  WHERE id = '.$row['id'].'
    504504;';
    505         mysql_query( $query );
     505        pwg_query( $query );
    506506      }
    507507    }
     
    599599  $query.= " WHERE status = 'private'";
    600600  $query.= ';';
    601   $result = mysql_query( $query );
     601  $result = pwg_query( $query );
    602602  $privates = array();
    603603  while ( $row = mysql_fetch_array( $result ) )
     
    612612  $query.= ' WHERE user_id = '.$user_id;
    613613  $query.= ';';
    614   $result = mysql_query( $query );
     614  $result = pwg_query( $query );
    615615  while ( $row = mysql_fetch_array( $result ) )
    616616  {
     
    627627    $query.= ' AND ug.user_id = '.$user_id;
    628628    $query.= ';';
    629     $result = mysql_query( $query );
     629    $result = pwg_query( $query );
    630630    while ( $row = mysql_fetch_array( $result ) )
    631631    {
     
    650650      $query = 'SELECT id FROM '.CATEGORIES_TABLE;
    651651      $query.= " WHERE visible = 'false';";
    652       $result = mysql_query( $query );
     652      $result = pwg_query( $query );
    653653      while ( $row = mysql_fetch_array( $result ) )
    654654      {
     
    680680  $query .= ' WHERE id = '.$user_id;
    681681  $query.= ';';
    682   mysql_query( $query );
     682  pwg_query( $query );
    683683
    684684  return $restrictions;
     
    699699  $query.= ' WHERE id = '.$user_id;
    700700  $query.= ';';
    701   $row = mysql_fetch_array( mysql_query( $query ) );
     701  $row = mysql_fetch_array( pwg_query( $query ) );
    702702 
    703703  $base_restrictions=get_user_restrictions($user_id,$row['status'],true,true);
     
    728728  $query.= ' WHERE id = '.$category_id;
    729729  $query.= ';';
    730   $row = mysql_fetch_array( mysql_query( $query ) );
     730  $row = mysql_fetch_array( pwg_query( $query ) );
    731731  $uppercats = explode( ',', $row['uppercats'] );
    732732  foreach ( $uppercats as $category_id ) {
Note: See TracChangeset for help on using the changeset viewer.