public static function search($search_word) { $query = DB::connection()->prepare('SELECT * FROM Drinks WHERE drink_name LIKE :search_word'); $query->execute(array("%{$search_word}%")); $rows = $query->fetchAll(PDO::FETCH_OBJ); $drinks = array(); foreach ($rows as $row) { $drinks[] = Drink::fillAttributesFromQuery($row); } return $drinks; }