示例#1
0
 public static function getAllUsers()
 {
     $query = "SELECT * FROM Users";
     $users = array();
     try {
         $db = Database::getDB();
         $statement = $db->prepare($query);
         $statement->execute();
         $users = UsersDB::getUsersArray($statement->fetchAll(PDO::FETCH_ASSOC));
         $statement->closeCursor();
     } catch (PDOException $e) {
         // Not permanent error handling
         echo "<p>Error getting all users " . $e->getMessage() . "</p>";
     }
     return $users;
 }
示例#2
0
 public static function getUsersBy($type, $value)
 {
     // Returns a User object whose $type field has value $value
     $userRows = UsersDB::getUserRowSetsBy($type, $value, '*');
     return UsersDB::getUsersArray($userRows);
 }
示例#3
0
 public static function getUsersBy($type = null, $value = null)
 {
     // Returns User objects whose $type field has value $value
     $userRows = UsersDB::getUserRowSetsBy($type, $value);
     return UsersDB::getUsersArray($userRows);
 }
 public static function getUsersBy($type = null, $value = null)
 {
     $userRows = UsersDB::getUserRowSetsBy($type, $value);
     return UsersDB::getUsersArray($userRows);
 }