当前位置: 首页>>代码示例>>PHP>>正文


PHP Base::executeQuery方法代码示例

本文整理汇总了PHP中Base::executeQuery方法的典型用法代码示例。如果您正苦于以下问题:PHP Base::executeQuery方法的具体用法?PHP Base::executeQuery怎么用?PHP Base::executeQuery使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Base的用法示例。


在下文中一共展示了Base::executeQuery方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getAllAuthorsByFirstLetter

 public static function getAllAuthorsByFirstLetter()
 {
     list(, $result) = parent::executeQuery("select {0}\nfrom authors\ngroup by substr (upper (sort), 1, 1)\norder by substr (upper (sort), 1, 1)", "substr (upper (sort), 1, 1) as title, count(*) as count", "", array(), -1);
     $entryArray = array();
     while ($post = $result->fetchObject()) {
         array_push($entryArray, new Entry($post->title, Author::getEntryIdByLetter($post->title), str_format(localize("authorword", $post->count), $post->count), "text", array(new LinkNavigation("?page=" . parent::PAGE_AUTHORS_FIRST_LETTER . "&id=" . rawurlencode($post->title))), "", $post->count));
     }
     return $entryArray;
 }
开发者ID:ha-y,项目名称:cops,代码行数:9,代码来源:author.php

示例2: getAllTagsByQuery

 public static function getAllTagsByQuery($query, $n, $database = NULL, $numberPerPage = NULL)
 {
     $columns = "tags.id as id, tags.name as name, (select count(*) from books_tags_link where tags.id = tag) as count";
     $sql = 'select {0} from tags where upper (tags.name) like ? {1} order by tags.name';
     list($totalNumber, $result) = parent::executeQuery($sql, $columns, "", array('%' . $query . '%'), $n, $database, $numberPerPage);
     $entryArray = array();
     while ($post = $result->fetchObject()) {
         $tag = new Tag($post);
         array_push($entryArray, new Entry($tag->name, $tag->getEntryId(), str_format(localize("bookword", $post->count), $post->count), "text", array(new LinkNavigation($tag->getUri()))));
     }
     return array($entryArray, $totalNumber);
 }
开发者ID:BreizhCat,项目名称:cops,代码行数:12,代码来源:tag.php

示例3: getEntryArray

 public static function getEntryArray($query, $params)
 {
     list(, $result) = parent::executeQuery($query, self::RATING_COLUMNS, "", $params, -1);
     $entryArray = array();
     while ($post = $result->fetchObject()) {
         $ratingObj = new Rating($post->id, $post->rating);
         $rating = $post->rating / 2;
         $rating = str_format(localize("ratingword", $rating), $rating);
         array_push($entryArray, new Entry($rating, $ratingObj->getEntryId(), str_format(localize("bookword", $post->count), $post->count), "text", array(new LinkNavigation($ratingObj->getUri())), "", $post->count));
     }
     return $entryArray;
 }
开发者ID:leader716,项目名称:cops,代码行数:12,代码来源:rating.php

示例4: getEntryArray

 public static function getEntryArray($query, $params, $n, $database = NULL, $numberPerPage = NULL)
 {
     list($totalNumber, $result) = parent::executeQuery($query, self::BOOK_COLUMNS, self::getFilterString(), $params, $n, $database, $numberPerPage);
     $entryArray = array();
     while ($post = $result->fetchObject()) {
         $book = new Book($post);
         array_push($entryArray, $book->getEntry());
     }
     return array($entryArray, $totalNumber);
 }
开发者ID:ha-y,项目名称:cops,代码行数:10,代码来源:book.php


注:本文中的Base::executeQuery方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。