本文整理汇总了PHP中getData函数的典型用法代码示例。如果您正苦于以下问题:PHP getData函数的具体用法?PHP getData怎么用?PHP getData使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了getData函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getSummaryDayData
function getSummaryDayData($timestamp = '')
{
$date = !empty($timestamp) ? date('Y-m-d', $timestamp) : date('Y-m-d');
$arrQuery = array('created_d' => $date);
$retval = getData($arrQuery);
return $retval;
}
示例2: getPlayer
public static function getPlayer($gt, $platform)
{
$url = 'http://www.bungie.net/Platform/Destiny/SearchDestinyPlayer/' . $platform . '/' . $gt;
$r = json_decode(getData($url));
$p = new Player($r->Response[0]->iconPath, $r->Response[0]->membershipType, $r->Response[0]->membershipId, $r->Response[0]->displayName);
return $p;
}
示例3: reset
public function reset()
{
$_SESSION['pk'] = 10;
// <-- start fake pks at 10
$_SESSION['rs'] = getData();
// <-- populate $_SESSION with data.
}
示例4: email
function email()
{
$headers = "From: order@mathsbooksforchildren.co.uk\r\n";
$headers .= "Content-type: text/html charset=iso-8859-1 \r\n";
$query = "select order_id, room_no, CONCAT(fname,' ', mname ,' ', lname) as cust_name ,phone_no,Adults, Child_A from reservation inner join customer on reservation.cust_id=customer.cust_id where arrival_date='" . date('Y-m-d 11:00:00') . "' and reservation.status='active'";
$guest = getData($query);
if (!empty($guest)) {
$message = '
<html>
<head>
<title>Some title</title>
</head>
<body>
<table>
<caption>Guests Arriving Today</caption>
<thead>
<tr><th>Room_no</th>
<th>Customer Details</th>
<th>Contacts</th>
<th>Adults</th>
<th>Children</th></tr>
</thead>';
$table = '';
foreach ($guest as $value) {
$table .= '<tbody><tr><td>' . $value['room_no'] . '</td><td>' . $value['cust_name'] . '</td><td>' . $value['phone_no'] . '</td><td>' . $value['Adults'] . '</td><td>' . $value['Child_A'] . '</td></tr></tbody>';
}
$table .= '</table></html>';
$msg = $message . $table;
// use wordwrap() if lines are longer than 70 characters
$msg = wordwrap($msg, 70);
// send email
mail("benard@starletcentre.co.ke", "Guests Arriving today", $msg, $headers);
}
}
示例5: lookup
function lookup($date)
{
$temp = split("/", $date);
$monthname = $temp[0] . $temp[1];
$folder = "./data/{$monthname}";
$drc = dir($folder);
$datas = array();
$count = 0;
if ($drc != null) {
while ($fl = $drc->read()) {
$lfl = $folder . "/" . $fl;
$din = pathinfo($lfl);
if ($fl != ".." && $fl != ".") {
$temp = getData($folder . "/" . $fl);
$rec = array();
foreach ($temp as $data) {
list($key, $value) = split('":"', $data);
$key = stlipQuot($key);
$value = stlipQuot($value);
$rec[$key] = $value;
}
$datas[] = $rec;
$count++;
}
}
$drc->close();
}
if ($count > 0) {
$datas = JEncode($datas);
echo '({"total":"' . $count . '","results":' . $datas . '})';
} else {
echo '({"total":"0","results":""})';
}
}
示例6: getLeaderboardIdFromSteam
function getLeaderboardIdFromSteam($date = 0)
{
global $config;
$url = $config['leaderboards']['baseUrl'] . '?xml=1';
$lbName = date('Ymd') . '_scores';
// don't look at me like that
try_again:
$data = getData($url);
$xml = new SimpleXMLElement($data);
$lbid = '';
// since leaderboards are being created in advance by the devs, we need to
// make sure we're getting a valid one, where 'valid' means with at least
// 50 entries - we'd get an empty one at midnight otherwise.
foreach ($xml as $x) {
if ($date == 1) {
$lbName = date('Ymd', strtotime('-1 day', strtotime(date('r')))) . '_scores';
}
if ($x->name == $lbName) {
if ($x->entries < 50) {
echo "[{$x->name} has {$x->entries} entries, something's up]\n";
//sleep(5);
//goto try_again;
}
return $x->lbid;
}
}
}
示例7: checkTweets
function checkTweets($newsitem)
{
$backtweet_api_key = "93cf9404dc4d8aebe92f";
$q = $newsitem["url"];
$newsitem_id = $newsitem["id"];
echo "querying: " . $q . "<br>";
$sinceString = "";
$since_result = mysql_query("SELECT * FROM backtweets_db WHERE newswire_id=" . $newsitem_id . " ORDER BY tweet_id DESC LIMIT 1");
if ($since_result) {
$since_row = mysql_fetch_assoc($since_result);
$since_id = $since_row["tweet_id"];
$sinceString .= "&since_id=" . $since_id;
}
echo "<br>since string: " . $sinceString . " since_id: " . $since_id . "<br>";
$jsonString = getData("http://backtweets.com/search.json?q=" . $q . "&key=" . $backtweet_api_key . "&itemsperpage=100" . $sinceString);
$tweetsObj = json_decode($jsonString);
//echo "status: ".$tweetsObj->status;
//echo $jsonString;.
echo "total results: " . $tweetsObj->totalresults . "<br>";
//$indexable = 1;
//if ($tweetsObj->totalresults < 1) {
// if ($newsitem["indexed"] > 2) {
//$indexable = 0;
// }
//}
//mysql_query( "UPDATE newswire_tb SET indexable=".$indexable.", indexed=indexed+1 WHERE id=".$newsitem["id"] );
for ($i = 0; $i < count($tweetsObj->tweets); $i++) {
// echo $tweetsObj->tweets[$i]->tweet_from_user ."<br>";
echo "<br>Tweet: since id : " . $sinceString . "<br>";
insertTweet($tweetsObj->tweets[$i], $newsitem["id"]);
echo "<br><br>";
}
}
示例8: loginOverride
function loginOverride($coreUserInfo)
{
global $gasDatabaseName, $CoreUserTableName;
if ($coreUserInfo["ErrorCode"] == 0) {
$uid = $coreUserInfo["Result"]["Uid"];
connectDB($gasDatabaseName);
$sql = "select * from {$CoreUserTableName} where Uid = '{$uid}'";
$data = getData($sql);
$info = array();
if (!empty($data)) {
$data = $data[0];
foreach ($data as $key => $value) {
$info["{$key}"] = $value;
}
} else {
printResultByMessage("用戶未註冊", 1001);
}
foreach ($coreUserInfo["Result"] as $key => $value) {
$info["{$key}"] = $value;
}
$_SESSION["Info"] = $info;
echo json_encode($coreUserInfo);
die;
}
}
示例9: dekodieren
function dekodieren($in)
{
global $ks_hilf;
$conn = new PDO('sqlite:' . $ks_hilf[pfad] . '/navajo.sqlite');
$buffer = explode(' ', trim($in));
$cc = 0;
foreach ($buffer as $key => $value) {
$sql = 'SELECT count(*) AS NUM FROM data WHERE NAVAJO LIKE "' . $value . '" ORDER BY RANDOM() LIMIT 1';
$data = getData($conn, $sql);
$temp = $data[0][NUM];
$cc++;
if ($temp == 0) {
$out .= '[' . $value . ']';
} else {
$sql = 'SELECT * FROM data WHERE NAVAJO = "' . $value . '" ORDER BY RANDOM() LIMIT 1';
$data = getData($conn, $sql);
$tmp = $data[0][ENGLISCH];
if ($tmp == "SPACE") {
$tmp = " ";
}
$out .= $tmp;
}
}
return trim($out);
}
示例10: GetPostInfo
public static function GetPostInfo($id)
{
try {
$safeId = ensureInt($id, 10);
} catch (Exception $e) {
throw new Exception('获取墙贴信息失败:' . $e->getMessage());
return null;
}
$cacheKey = 'postinfo_' . $safeId;
$cache = getCache($cacheKey);
if ($cache == null) {
$sql = "select `post_id`,`post_creator`, `post_wall`, `post_title`, `post_content`, `post_time` from wa_post where post_id = {$safeId} limit 1";
$ret = getData($sql);
if ($ret == null) {
throw new Exception('获取墙贴信息失败。');
return null;
} else {
$ret = $ret[0];
setCache($cacheKey, $ret);
return $ret;
}
} else {
return $cache;
}
}
示例11: getCmd
/**
*
* @param unknown $httpReq
*/
function getCmd($httpReq)
{
$reqdecoded = getData($httpReq);
if (!isset($reqdecoded['cmd'])) {
WrongRequestException::throwException(8010, '>cmd< is missing in request', 'got: ' . $httpReq);
}
return $reqdecoded['cmd'];
}
示例12: __construct
function __construct()
{
session_start();
if (!isset($_SESSION['pk'])) {
$_SESSION['pk'] = 5;
$_SESSION['rs'] = getData();
}
}
示例13: page
public function page()
{
$this->dbinfo = \H::getJSONData("credentials");
if (getData("credentials") != null && $this->connect($this->dbinfo)) {
$this->set = true;
}
return "auto";
}
示例14: adicionar
public function adicionar($conexao, $acao, $oQue, $quem, $qual)
{
try {
$timestamp = getTimestamp();
$conexao->query()->from("logs")->save(array("acao" => $acao, "oque" => $oQue, "quem" => $quem, "qual" => $qual, "data" => getData($timestamp), "timestampData" => $timestamp));
} catch (Exception $e) {
throw $e;
}
}
示例15: __construct
public function __construct()
{
if (!isset($_SESSION['pk'])) {
$_SESSION['pk'] = 10;
// <-- start fake pks at 10
$_SESSION['rs'] = getData();
// <-- populate $_SESSION with data.
}
}