本文整理汇总了PHP中DB_Functions::getAllEvents方法的典型用法代码示例。如果您正苦于以下问题:PHP DB_Functions::getAllEvents方法的具体用法?PHP DB_Functions::getAllEvents怎么用?PHP DB_Functions::getAllEvents使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DB_Functions
的用法示例。
在下文中一共展示了DB_Functions::getAllEvents方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1:
if ($tag == 'gete') {
$e = $_POST['e'];
$event = $db->getEvent($e);
if ($event) {
$response["success"] = 1;
$response["evInfo"] = $event;
echo json_encode($response);
} else {
$response["error"] = 21;
$response["error_msg"] = "event not found";
echo json_encode($response);
}
} else {
if ($tag == 'all') {
$u = $_POST['u'];
$events = $db->getAllEvents($u);
print_r($events);
if ($events) {
$response["success"] = 1;
$response["evInfo"] = $events;
echo json_encode($response);
} else {
$response["error"] = 23;
$response["error_msg"] = "no events found";
echo json_encode($response);
}
} else {
if ($tag == 'rems') {
$eno = $_POST['eno'];
$reminders = $db->getReminder($eno);
if ($reminders) {
示例2: array
<?php
require_once 'include/DB_Functions.php';
$db = new DB_Functions();
$result = $db->getAllEvents();
// json response array
$response = array("error" => FALSE);
if ($result) {
// looping through all results
// products node
$response["events"] = array();
foreach ($result as $row) {
// temp user array
$event = array();
$event["eid"] = $row["eventID"];
$event["ename"] = $row["ename"];
$event["location"] = $row["location"];
$event["description"] = $row["description"];
$event["edate"] = $row["edate"];
// push single product into final response array
array_push($response["events"], $event);
}
// success
$response["error"] = FALSE;
// echoing JSON response
echo json_encode($response);
} else {
$response["error"] = TRUE;
$response["error_msg"] = "Required parameters (name,age,email or password) is missing!";
echo json_encode($response);
}