Exemple #1
0
 /**
  * Find a user by userid.
  *
  * @param int $userid The userid to look up
  * @return UserRecord The matching user record or null if none
  */
 static function getUser($userid)
 {
     $db = new DatabaseConnection();
     $record = $db->getSingleRow("SELECT a.*,u.*,a.id AS userid FROM users a LEFT JOIN userdata u ON a.id=u.id WHERE a.id=%d", $userid);
     if ($record) {
         $u = new UserRecord();
         $u->assign($record);
         return $u;
     }
     return null;
 }