<?php
namespace user;

class User
{
  public $_values;
  
  public function __construct( $id = '' )
  {
    global $db;    
    
    $query = $db -> prepare( 'SELECT * FROM pp_users WHERE id = :id' );
    $query -> bindValue( ':id', $id, \PDO::PARAM_INT );
    $query -> execute();
    if ( $query -> rowCount() ) while ( $row = $query -> fetch() )
    {
      foreach ( $row as $key => $val )
        $this -> _values[$key] = $val;
    }
    $query -> closeCursor();
    return true;
  }
}
?>
