Ignore:
Timestamp:
Oct 30, 2004, 5:42:29 PM (19 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/include/functions_user.inc.php

    r532 r587  
    7070    $query.= " WHERE username = '".$login."'";
    7171    $query.= ';';
    72     $result = mysql_query( $query );
     72    $result = pwg_query( $query );
    7373    if ( mysql_num_rows($result) > 0 ) $error[$i++] = $lang['reg_err_login5'];
    7474  }
     
    9595    $query.= " WHERE username = 'guest'";
    9696    $query.= ';';
    97     $row = mysql_fetch_array( mysql_query( $query ) );
     97    $row = mysql_fetch_array( pwg_query( $query ) );
    9898    // 2. adding new user
    9999    $query = 'INSERT INTO '.USERS_TABLE;
     
    116116    }
    117117    $query.= ');';
    118     mysql_query( $query );
     118    pwg_query( $query );
    119119    // 3. retrieving the id of the newly created user
    120120    $query = 'SELECT id';
    121121    $query.= ' FROM '.USERS_TABLE;
    122122    $query.= " WHERE username = '".$login."';";
    123     $row = mysql_fetch_array( mysql_query( $query ) );
     123    $row = mysql_fetch_array( pwg_query( $query ) );
    124124    $user_id = $row['id'];
    125125    // 4. adding access to the new user, the same as the user "guest"
     
    129129    $query.= ' where u.id = ua.user_id';
    130130    $query.= " and u.username = 'guest';";
    131     $result = mysql_query( $query );
     131    $result = pwg_query( $query );
    132132    while( $row = mysql_fetch_array( $result ) )
    133133    {
     
    135135      $query.= ' (user_id,cat_id) VALUES';
    136136      $query.= ' ('.$user_id.','.$row['cat_id'].');';
    137       mysql_query ( $query );
     137      pwg_query ( $query );
    138138    }
    139139    // 5. associate new user to the same groups that the guest
     
    144144    $query.= ' AND ug.user_id = u.id';
    145145    $query.= ';';
    146     $result = mysql_query( $query );
     146    $result = pwg_query( $query );
    147147    while( $row = mysql_fetch_array( $result ) )
    148148    {
     
    151151      $query.= ' ('.$user_id.','.$row['group_id'].')';
    152152      $query.= ';';
    153       mysql_query ( $query );
     153      pwg_query ( $query );
    154154    }
    155155  }
     
    188188    $query.= ' WHERE id = '.$user_id;
    189189    $query.= ';';
    190     mysql_query( $query );
     190    pwg_query( $query );
    191191  }
    192192  return $error;
     
    271271  $sql.= " WHERE ";
    272272  $sql .= ( ( is_integer($user) ) ? "id = $user" : "username = '" .  str_replace("\'", "''", $user) . "'" ) . " AND id <> " . ANONYMOUS;
    273   $result = mysql_query($sql);
     273  $result = pwg_query($sql);
    274274  return ( $row = mysql_fetch_array($result) ) ? $row : false;
    275275}
Note: See TracChangeset for help on using the changeset viewer.