本文整理匯總了PHP中DBAccess::getAllConstellationPresent方法的典型用法代碼示例。如果您正苦於以下問題:PHP DBAccess::getAllConstellationPresent方法的具體用法?PHP DBAccess::getAllConstellationPresent怎麽用?PHP DBAccess::getAllConstellationPresent使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類DBAccess
的用法示例。
在下文中一共展示了DBAccess::getAllConstellationPresent方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: count
<?php
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 . ",";