first commit
This commit is contained in:
24
autoload/user/class.User.php
Normal file
24
autoload/user/class.User.php
Normal file
@@ -0,0 +1,24 @@
|
||||
<?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;
|
||||
}
|
||||
}
|
||||
?>
|
||||
Reference in New Issue
Block a user