本文整理匯總了PHP中DBAccess::getPictureByPictureID方法的典型用法代碼示例。如果您正苦於以下問題:PHP DBAccess::getPictureByPictureID方法的具體用法?PHP DBAccess::getPictureByPictureID怎麽用?PHP DBAccess::getPictureByPictureID使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類DBAccess
的用法示例。
在下文中一共展示了DBAccess::getPictureByPictureID方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: realpath
<?php
$root = realpath($_SERVER["DOCUMENT_ROOT"]);
include_once $root . '/scripts/DBAccess.php';
$imageID = $_GET['imageID'];
if (!is_numeric($imageID)) {
$title = "Images: ";
$content = " ";
require $root . '/template/userTemplate.php';
die;
}
$result = DBAccess::getPictureByPictureID($imageID, TRUE);
$member = NULL;
if ($result[0]['UserID'] != NULL) {
$member = DBAccess::getUserByUserID($result[0]['UserID']);
}
$title = '' . $result[0]['PictureName'];
$head = '<meta name="description" content="' . $result[0]['PictureDescription'] . '">';
$content = "\n\t<h1 class=\"heading\">" . $result[0]['PictureName'] . "</h1>\n\t<div class=\"container2\">";
if ($member != NULL) {
$content .= "<label class=\"formLabel\">Member:</label><label class=\"formField\">" . $member[0]['FirstName'] . " " . $member[0]['LastName'] . "</label>";
}
$content .= "<label class=\"formLabel\">Name:</label><label class=\"formField\">" . $result[0]['PictureName'] . "</label>\n\t<label class=\"formLabel\">Description:</label><label class=\"formField\">" . $result[0]['PictureDescription'] . "</label>\n\t<label class=\"formLabel\">Date:</label><label class=\"formField\">" . date('F, Y', strtotime($result[0]['PictureDate'])) . "</label>\n\n\t<img style=\"padding:50px 0px;display: block;margin-left: auto;margin-right: auto \" src=\"/Images/" . $result[0]['PictureImage'] . "\" alt=\"" . $result[0]['PictureName'] . "\" width=\"800\" />\n\t</div>\n\t\t";
require $root . '/template/userTemplate.php';
?>
示例2: count
include_once './DBAccess.php';
$method = $_GET['method'];
if ($method = 'star-game') {
$fired = false;
//Get the actual constellation to guess
$conResult = DBAccess::getAllConstellationPresent();
$rows = count($conResult, 0);
$randomNumber = mt_rand(0, $rows - 1);
//$randomNumber = $randomNumber * date('s');
//$randomNumber = $randomNumber % ($rows - 1);
$StarPairResult = DBAccess::getStarPairs($conResult[$randomNumber]['ConstellationID']);
$starRows = count($StarPairResult, 0);
$randomPairNo = mt_rand(0, $starRows - 1);
$total = $starRows - 1;
$pictureReal = DBAccess::getPictureByPictureID($StarPairResult[$randomPairNo]['StarPictureID'], NULL);
$pictureLine = DBAccess::getPictureByPictureID($StarPairResult[$randomPairNo]['LinePictureID'], TRUE);
$targetConID = $conResult[$randomNumber]['ConstellationID'];
//Constellation Target
$starID = $StarPairResult[$randomPairNo]['StarPictureID'];
$hash = sha1($targetConID);
$correctAnswer = "";
//Image Details
echo $pictureReal[0]['PictureImage'] . ",";
echo $conResult[$randomNumber]['ConstellationCartoon'] . ",";
$description = $conResult[$randomNumber]['ConstellationDescription'] . ",";
$name = $conResult[$randomNumber]['ConstellationName'];
echo $hash . ", ";
$correctAnswer .= $name . ",";
$correctAnswer .= $targetConID . ",";
$randNo = mt_rand(0, 10);
if ($randNo < 4) {