You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
- <?php
-
- class
- User
- {
- var $id;
- var $name;
- var $pass;
-
- public static function
- find (
- int $id):
- Self
- {
- $sql = "
- SELECT
- *
- FROM
- user
- WHERE
- id = $id";
- $result = $GLOBALS['__db_connection'] -> query ($sql)
- or die ("db_select error $sql");
-
- $row = $this -> db -> fetch_array ($result);
-
- $self = new Self;
- $self -> id = $id;
- $self -> name = $row['name'];
- $self -> pass = $row['pass'];
-
- return $self;
- }
- }
|