本文整理汇总了PHP中Query::whereQuery方法的典型用法代码示例。如果您正苦于以下问题:PHP Query::whereQuery方法的具体用法?PHP Query::whereQuery怎么用?PHP Query::whereQuery使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Query
的用法示例。
在下文中一共展示了Query::whereQuery方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setItems
public function setItems()
{
// Items at level
$date = $this->matruschka ? $this->matruschka->pubDate : date("Y-m-d H:i:s");
// Order number
$orderQ = new Query("matruschka");
if ($parent) {
$orderQ->whereQuery("mOrderNo", "mParent", $parent, 'mOrderNo', 'DESC', 1);
$order = $orderQ->getResultRow('mOrderNo') + 1;
} else {
$order = 1;
}
$orderNo = $this->matruschka ? $this->matruschka->orderNo : $order;
$this->items[0][] = new ItemImage($this->matruschka->ID, $this->matruschka->images, "Bild. 200 x _ px", 1);
$this->items[0][] = new ItemTitle($this->matruschka->ID, $this->matruschka->title, "Titel", 0);
$this->items[0][] = new ItemButtonTitle($this->matruschka->ID, $this->matruschka->buttonTitle, "KnappTitel (Mest för navigering i adminsidan)", 0);
$this->items[0][] = new ItemButtonImage($this->matruschka->ID, $this->matruschka->buttonImage, "Knappbild t.ex (bild1.gif,bild2.gif)", 0);
$this->items[0][] = new ItemDescription($this->matruschka->ID, $this->matruschka->description, "Text", 0);
$this->items[0][] = new ItemPublished($this->matruschka->ID, $this->matruschka->published, "Publicerad", 0);
$this->items[0][] = new ItemOrderNo($this->matruschka->ID, $orderNo, "Ordningsnummer. Till menyraden.", 0);
$this->items[1][] = new ItemButtonTitle($this->matruschka->ID, $this->matruschka->buttonTitle, "Knapptitel", 0);
$this->items[1][] = new ItemPublished($this->matruschka->ID, $this->matruschka->published, "Publicerad", 0);
$this->items[1][] = new ItemOrderNo($this->matruschka->ID, $orderNo, "Ordningsnummer. Till vänstermenyn.", 0);
$this->items[2][] = new ItemImage($this->matruschka->ID, $this->matruschka->images, "Bild. 200 x _ px", 1);
$this->items[2][] = new ItemButtonTitle($this->matruschka->ID, $this->matruschka->buttonTitle, "Knapptitel", 0);
$this->items[2][] = new ItemTitle($this->matruschka->ID, $this->matruschka->title, "Titel", 0);
$this->items[2][] = new ItemDescription($this->matruschka->ID, $this->matruschka->description, "Text (All text här)", 0);
$this->items[2][] = new ItemPublished($this->matruschka->ID, $this->matruschka->published, "Publicerad", 0);
$this->items[2][] = new ItemOrderNo($this->matruschka->ID, $orderNo, "Ordningsnummer. Till vänstermenyn.", 0);
}
示例2: setItems
public function setItems()
{
// Items at level
$date = $this->matruschka ? $this->matruschka->pubDate : date("Y-m-d H:i:s");
// Order number
$orderQ = new Query("matruschka");
if ($_GET['parent']) {
$orderQ->whereQuery("mOrderNo", "mParent", $_GET['parent'], 'mOrderNo', 'DESC', 1);
$order = $orderQ->getResultRow('mOrderNo') + 1;
} else {
$order = 1;
}
$orderNo = $this->matruschka ? $this->matruschka->orderNo : $order;
$this->items[0][] = new ItemButtonTitle($this->matruschka->ID, $this->matruschka->buttonTitle, "Knapptitel", 0);
$this->items[0][] = new ItemButtonImage($this->matruschka->ID, $this->matruschka->buttonImage, "Knappbild", 0);
$this->items[0][] = new ItemPublished($this->matruschka->ID, $this->matruschka->published, "Publicerad", 0);
$this->items[0][] = new ItemOrderNo($this->matruschka->ID, $orderNo, "Ordningsnummer. Till menyraden.", 0);
$this->items[1][] = new ItemButtonTitle($this->matruschka->ID, $this->matruschka->buttonTitle, "Översta rubriken, ", 0);
$this->items[1][] = new ItemPublished($this->matruschka->ID, $this->matruschka->published, "Publicerad", 0);
$this->items[1][] = new ItemOrderNo($this->matruschka->ID, $orderNo, "Ordningsnummer. Till rubriker.", 0);
$this->items[2][] = new ItemTitle($this->matruschka->ID, $this->matruschka->title, "Titel", 0);
$this->items[2][] = new ItemButtonTitle($this->matruschka->ID, $this->matruschka->buttonTitle, "Bildspelstitel", 0);
$this->items[2][] = new ItemDescription($this->matruschka->ID, $this->matruschka->description, "Texten", 0);
$this->items[2][] = new ItemPublished($this->matruschka->ID, $this->matruschka->published, "Publicerad", 0);
$this->items[2][] = new ItemOrderNo($this->matruschka->ID, $orderNo, "Ordningsnummer. Till bildspel.", 0);
$this->items[3][] = new ItemTitle($this->matruschka->ID, $this->matruschka->title, "Titel", 0);
$this->items[3][] = new ItemImage($this->matruschka->ID, $this->matruschka->images, "Bild 400 x _ px ", 1);
$this->items[3][] = new ItemPublished($this->matruschka->ID, $this->matruschka->published, "Publicerad", 0);
$this->items[3][] = new ItemOrderNo($this->matruschka->ID, $orderNo, "Ordningsnummer.", 0);
}
示例3: showActual
public function showActual()
{
$id = (int) $_GET['id'];
if (Helper::givesResult($this->table, "rowid", $id)) {
$q = new Query($this->table);
$q->whereLeftJoinImageQuery("*", "rowid", $id, "rowid", "DESC");
$personal = new Query("personal");
$personal->whereQuery("*", "username", $q->getResultRow("published_by"), "rowid", "ASC", "1");
?>
<div class="newsHeader"><span class="dateAuthor">
<?php
echo date("Y-m-d", strtotime($q->getResultRow("date"))) . ' ' . $personal->getResultRow("first_name") . ' ' . $personal->getResultRow("last_name");
?>
</span><br /><br />
<span class="newsHeaderFont"><?php
echo $q->getResultRow("title");
?>
</span>
</div>
<div class="newsDescActual"><span class="boldGrey"><?php
echo nl2br(strip_tags($q->getResultRow("description"), '<a><b><br><strong>'));
?>
</span></div>
<div class="newsPicActual">
<?php
if ($q->getResultRow("image_id") > 0) {
?>
<table><tr><td>
<?php
echo '<img src="image_thumb.php?source=' . Settings::getUploadedImages() . '/' . $q->getResultRow("file") . '&width=340" alt="' . $q->getResultRow("name") . '" />';
?>
</td>
</tr>
<tr>
<td align="right" class="smallGrey2">
<?php
if ($q->getResultRow("photo") != "") {
echo '<span class="smallGrey">Foto: ' . $q->getResultRow("photo") . '</span>';
}
?>
</td>
</tr>
</table>
<?php
}
?>
</div>
<?php
echo nl2br(strip_tags($q->getResultRow("text"), '<a><b><br><strong>'));
?>
<br /><br />
<?php
}
}
示例4: getActive
private function getActive($id, $searched)
{
$q = new Query("matruschka");
$q->whereQuery("*", "mRowid", $id, "mRowid", "DESC", 0);
if ($q->getResultRow("mRowid") == $searched) {
return 1;
}
if ($q->getResultRow("mParent") == "") {
return 0;
} else {
return $this->getActive($q->getResultRow("mParent"), $searched);
}
}
示例5: setItems
public function setItems()
{
// Items at level
$date = $this->matruschka ? $this->matruschka->pubDate : date("Y-m-d H:i:s");
// Order number
$orderQ = new Query("matruschka");
if ($parent) {
$orderQ->whereQuery("mOrderNo", "mParent", $parent, 'mOrderNo', 'DESC', 1);
$order = $orderQ->getResultRow('mOrderNo') + 1;
} else {
$order = 1;
}
$orderNo = $this->matruschka ? $this->matruschka->orderNo : $order;
$this->items[0][] = new ItemTitle($this->matruschka->ID, $this->matruschka->title, "Titel", 0);
$this->items[0][] = new ItemDescription($this->matruschka->ID, $this->matruschka->description, "Text till vänster", 0);
$this->items[0][] = new ItemText($this->matruschka->ID, $this->matruschka->text, "Texten till höger", 0);
$this->items[0][] = new ItemPublished($this->matruschka->ID, $this->matruschka->published, "Publicerad", 0);
}
示例6: setItems
public function setItems()
{
// Items at level
$date = $this->matruschka ? $this->matruschka->pubDate : date("Y-m-d H:i:s");
// Order number
$orderQ = new Query("matruschka");
if ($parent) {
$orderQ->whereQuery("mOrderNo", "mParent", $parent, 'mOrderNo', 'DESC', 1);
$order = $orderQ->getResultRow('mOrderNo') + 1;
} else {
$order = 1;
}
$orderNo = $this->matruschka ? $this->matruschka->orderNo : $order;
$this->items[0][] = new ItemImage($this->matruschka->ID, $this->matruschka->images, "Bild. 250 x _ px", 1);
$this->items[0][] = new ItemButtonTitle($this->matruschka->ID, $this->matruschka->buttonTitle, "Knapptitel. (För adminsidan)", 1);
$this->items[0][] = new ItemText($this->matruschka->ID, $this->matruschka->text, "Texten under bilden", 1);
$this->items[0][] = new ItemPublished($this->matruschka->ID, $this->matruschka->published, "Publicerad", 1);
}
示例7: setItems
public function setItems()
{
// Items at level
$date = $this->matruschka ? $this->matruschka->pubDate : date("Y-m-d H:i:s");
// Order number
$orderQ = new Query("matruschka");
if ($_GET['parent']) {
$orderQ->whereQuery("mOrderNo", "mParent", $_GET['parent'], 'mOrderNo', 'DESC', 1);
$order = $orderQ->getResultRow('mOrderNo') + 1;
} else {
$order = 1;
}
$orderNo = $this->matruschka ? $this->matruschka->orderNo : $order;
$this->items[0][] = new ItemImage($this->matruschka->ID, $this->matruschka->images, "Bild 400 x _ px.", 1);
$this->items[0][] = new ItemButtonTitle($this->matruschka->ID, $this->matruschka->buttonTitle, "Rubriktitel (för navigering på adminsidan)", 0);
$this->items[0][] = new ItemTitle($this->matruschka->ID, $this->matruschka->title, "Titel", 0);
$this->items[0][] = new ItemButtonImage($this->matruschka->ID, $this->matruschka->buttonImage, "Knappbild (t.ex: bild1.gif,gid2.gif)", 0);
$this->items[0][] = new ItemDescription($this->matruschka->ID, $this->matruschka->description, "", 0);
$this->items[0][] = new ItemPublished($this->matruschka->ID, $this->matruschka->published, "Publicerad", 0);
$this->items[0][] = new ItemOrderNo($this->matruschka->ID, $orderNo, "Ordningsnummer. Till menyraden.", 0);
$this->items[1][] = new ItemButtonTitle($this->matruschka->ID, $this->matruschka->buttonTitle, "Rubriktitel", 0);
$this->items[1][] = new ItemPublished($this->matruschka->ID, $this->matruschka->published, "Publicerad", 0);
$this->items[1][] = new ItemOrderNo($this->matruschka->ID, $orderNo, "Ordningsnummer. Till vänstermenyn.", 0);
$this->items[2][] = new ItemButtonTitle($this->matruschka->ID, $this->matruschka->buttonTitle, "Knapptitel", 0);
$this->items[2][] = new ItemOrderNo($this->matruschka->ID, $orderNo, "Ordningsnummerför underlänkarna i Menyn", 0);
$this->items[2][] = new ItemPublished($this->matruschka->ID, $this->matruschka->published, "Publicerad", 0);
$this->items[3][] = new ItemImage($this->matruschka->ID, $this->matruschka->images, "Bild. 400px bred", 1);
$this->items[3][] = new ItemButtonTitle($this->matruschka->ID, $this->matruschka->buttonTitle, "Knapptitel (fyll endast i denna vid 3 nivåer)", 0);
$this->items[3][] = new ItemTitle($this->matruschka->ID, $this->matruschka->title, "Titel", 0);
$this->items[3][] = new ItemDescription($this->matruschka->ID, $this->matruschka->description, "Beskrivningen under bilden.", 0);
$this->items[3][] = new ItemText($this->matruschka->ID, $this->matruschka->text, "Texten bredvid bilden", 0);
$this->items[3][] = new ItemPublished($this->matruschka->ID, $this->matruschka->published, "Publicerad", 0);
$this->items[3][] = new ItemOrderNo($this->matruschka->ID, $orderNo, "Ordningsnummer. Numret som man trycker på. Nolla läggs till automatisk. Vid 3 nivåer i menyn blir det ordningsnumret i menyn.", 0);
$this->items[4][] = new ItemImage($this->matruschka->ID, $this->matruschka->images, "Bild. 400px", 1);
$this->items[4][] = new ItemTitle($this->matruschka->ID, $this->matruschka->title, "Titel", 0);
$this->items[4][] = new ItemDescription($this->matruschka->ID, $this->matruschka->description, "Beskrivningen under bilden.", 0);
$this->items[4][] = new ItemText($this->matruschka->ID, $this->matruschka->text, "Texten bredvid bilden", 0);
$this->items[4][] = new ItemPublished($this->matruschka->ID, $this->matruschka->published, "Publicerad", 0);
$this->items[4][] = new ItemOrderNo($this->matruschka->ID, $orderNo, "Ordningsnummer. Numret som man trycker på. Nolla läggs till automatisk.", 0);
}
示例8: set
public function set($ID)
{
$q = new Query("matruschka");
$q->whereQuery("*", "mRowid", $ID, "mRowid", "ASC", 1);
$this->parent = $q->getResultRow("mParent");
$this->title = $q->getResultRow("mTitle");
$this->buttonTitle = $q->getResultRow("mButtonTitle");
$this->buttonImage = $q->getResultRow("mButtonImage");
$this->title = $q->getResultRow("mTitle");
$this->text = $q->getResultRow("mText");
$this->orderNo = $q->getResultRow("mOrderNo");
$this->level = $q->getResultRow("mLevel");
$this->description = $q->getResultRow("mDescription");
$this->pubDate = $q->getResultRow("mPubDate");
$this->published = $q->getResultRow("mPublished");
$this->adminLevel = $q->getResultRow("mAdminLevel");
$this->showStyle = $q->getResultRow("mShowStyle");
$this->lang = $q->getResultRow("mLang");
$this->setImages();
$this->setShowAtPlaces();
$this->setBelongingPlaces();
}
示例9: nl2br
<?php
include "admin_header.php";
$query = "SELECT * FROM vimmel_images WHERE image_id='" . $_GET['image_id'] . "' AND category='" . $_GET['category'] . "'";
$result = mysql_query($query) or die(mysql_error());
$rows = mysql_num_rows($result);
if (isset($_GET['action']) && $_GET['action'] == "add_image" && $rows == 0) {
$query = "INSERT INTO vimmel_images SET image_id='" . $_GET['image_id'] . "',category='" . $_GET['category'] . "', published_by='" . $_SESSION['admin_logged'] . "', date=CURRENT_TIMESTAMP";
$result = mysql_query($query) or die(mysql_error());
}
$vimmelQ = new Query("vimmel_categories");
$vimmelQ->whereQuery("*", "rowid", $_GET['category'], "rowid", "ASC", 1);
echo "<h2>" . $vimmelQ->getResultRow("title") . "</h2>";
echo nl2br($vimmelQ->getResultRow("description"));
?>
<h4>Klicka på en bild för att lägga till en liten text.</h4>
<?php
$rad = 0;
//altaernerar färg
$images_per_row = 6;
$pagesize = 60;
$recordstart = (int) $_GET['recordstart'];
//ändra
$recordstart = isset($_GET['recordstart']) ? $_GET['recordstart'] : 0;
//ändra recordstart variabelnamn
$query = "SELECT * FROM vimmel_images \n\t\tLEFT JOIN bilder\n\t\tON image_id = bilder.id\n\t\tWHERE vimmel_images.category='" . $_GET['category'] . "'\n\t\tORDER BY vimmel_images.date DESC \n\t\tLIMIT " . $recordstart . " , " . $pagesize . " ";
$result = mysql_query($query) or die(mysql_error());
//sidnummer under
?>
示例10: Query
<?php
}
$paging;
$query = new Query("advertisement");
if (isset($_GET['category'])) {
$query->whereQuery("*", "category", $_GET['category'], "date", "DESC", 1000);
$paging = new Paging($query, 20);
$paging->where("*", "category", $_GET['category'], "date", "DESC");
} else {
$query->makeQuery("*", "date", "DESC", 100);
$paging = new Paging($query, 20);
$paging->makePagingQuery();
}
while ($row = mysql_fetch_assoc($paging->getResult())) {
$getCategory = new Query("advertisement_categories");
$getCategory->whereQuery("*", "rowid", $row['category'], "rowid", "ASC", 1000);
?>
<table border="0" cellpadding="0" cellspacing="0" class="demoTable">
<tr>
<td class="tdPadding" colspan="2"><span class="boldGreyLighter"><?php
echo $row['title'];
?>
</span><span class="smallGrey"> -
<?php
echo $getCategory->getResultRow("category");
?>
</span><br /><br />
</td>
</tr>
示例11: newEntryPlace
private function newEntryPlace()
{
echo "Skapat";
$image = $_POST['image'];
$title = $_POST['title'];
$description = $_POST['description'];
$parent = $_POST['parent'];
$requiredTitle = $_POST['requiredTitle'];
$requiredDescription = $_POST['requiredDescription'];
$requiredText = $_POST['requiredText'];
$requiredComments = $_POST['requiredComments'];
$requiredImage = $_POST['requiredImage'];
$requiredRate = $_POST['requiredRate'];
$pubDate;
if ($published == 1) {
$pubDate = date("Y-m-d H:i:s");
} else {
$pubDate = "";
}
$q = new Query('entryPlaces');
$q->whereQuery("*", "title", $title, "title", "DESC", 0);
if ($q->getNumRows() == 0) {
$query = "INSERT INTO entryPlaces \n\t\t\t\t\tSET image='{$image}',\n\t\t\t\t\t\ttitle='{$title}',\n\t\t\t\t\t\tdescription='{$description}',\n\t\t\t\t\t\tpubDate='{$pubDate}',\n\t\t\t\t\t\trequiredTitle='{$requiredTitle}',\n\t\t\t\t\t\trequiredDescription='{$requiredDescription}',\n\t\t\t\t\t\trequiredText='{$requiredText}',\n\t\t\t\t\t\trequiredComments='{$requiredComments}',\n\t\t\t\t\t\trequiredImage='{$requiredImage}',\n\t\t\t\t\t\trequiredRate='{$requiredRate}'";
$result = mysql_query($query) or die(mysql_error());
}
}
示例12: Query
<?php
include "header_inc.php";
?>
<div id="centerDiv">
<div class="newsBg">
<?php
if (isset($_GET['category']) && Helper::isInt($_GET['category'])) {
$category = new Query("vimmel_categories");
$category->whereQuery("*", "rowid", $_GET['category'], "date", "DESC", 1);
echo '<span class="boldWhite">' . $category->getResultRow("title") . '</span><br />';
echo '<span class="smallWhite">' . nl2br($category->getResultRow("description")) . '</span>';
if (Helper::isInt($_GET['id']) && Helper::hasValue($_GET['id']) && Helper::givesResult("vimmel_images", "rowid", $_GET['id'])) {
$query = new Query("vimmel_images");
$query->whereLeftJoinImageQuery("*", "rowid", $_GET['id'], "rowid", "ASC");
$image = new ShowImages($query);
?>
<div class="showImg">
<br />
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td><?php
echo $image->showImage(350);
?>
</td>
</tr>
<tr>
<td align="right" class="smallGrey2"><?php
示例13: Query
<?php
include "header_inc.php";
echo '<div id="centerDiv">';
echo '<div class="newsBg">';
if (isset($_GET['id']) && Helper::isInt($_GET['id']) && Helper::givesResult("personal", "rowid", $_GET['id'])) {
$personal = new Query("personal");
$personal->whereQuery("*", "rowid", $_GET['id'], "rowid", "ASC", 1);
$topQ = new Query("top40");
$topQ->whereQuery("*", "top40Username", $personal->getResultRow("username"), "top40ID", "ASC", 40);
echo '<div class="newsHeaderActual">';
echo '<span class="newsHeaderFont">';
echo 'Topplistan cd & dvd, ' . $personal->getResultRow("first_name") . ' ' . $personal->getResultRow("last_name");
echo '</span>';
echo '</div>';
echo '<br/>';
echo "<ol >";
while ($row = mysql_fetch_object($topQ->getResult())) {
echo '<li style="font-weight:bold">';
echo $row->top40Group . ' - <span style="color:#000000;">' . $row->top40Album . '</span>';
echo '</li>';
}
echo "</ol>";
}
echo '</div>';
echo '</div>';
include "footer.php";
示例14: Query
<?php
include "admin_header.php";
?>
<h2>Prenumeranter</h2>
<a href="?type=try">Prov prunumeranter</a> | <a href="?type=year">1 års prenumeranter</a> <br/>
<br/>
<?php
if (isset($_GET['id'])) {
$prenQ = new Query("pren");
$prenQ->whereQuery("*", "PrenId", $_GET['id'], "PrenId", "DESC", 1);
?>
<table cellspacing="0" rules="rows" border="1" style="height:50px;border-collapse:collapse;">
<tr>
<td>PrenId</td>
<td><strong><?php
echo $prenQ->getResultRow("PrenId");
?>
</strong></td>
</tr>
<tr>
<td>PrenToName</td>
<td><strong><?php
echo $prenQ->getResultRow("PrenToName");
?>
</strong></td>
</tr>
<tr>
<td>PrenToCO</td>
示例15: createChild
/**
* Om man skapar ett barn
*/
private function createChild()
{
// hämta displaystyle
$q = new Query('matruschka');
$q->whereQuery("*", 'mRowid', $this->parent, 'mRowid', "DESC", 1);
$style = $q->getResultRow('mShowStyle');
$this->level = $q->getResultRow('mLevel') + 1;
if ($style == "Agree") {
$this->showStyle = new AdminAgree();
} else {
if ($style == "ImageShow") {
$this->showStyle = new AdminImageShow();
} else {
if ($style == "TextShow") {
$this->showStyle = new AdminTextShow();
} else {
if ($style == "Start") {
$this->showStyle = new AdminStart();
} else {
if ($style == "Gallery") {
$this->showStyle = new AdminGallery();
} else {
if ($style == "Contact") {
$this->showStyle = new AdminContact();
}
}
}
}
}
}
$this->showStyle->setParent($this->parent);
$this->showStyle->setItems();
$this->showStyle->setupBelongingPlaces($_GET['lang']);
$this->showStyle->setupShowAtPlaces($_GET['lang']);
}