本文整理汇总了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;
}
示例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);
}
示例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;
}
示例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);
}