當前位置: 首頁>>代碼示例>>PHP>>正文


PHP DB_Functions::getAllEvents方法代碼示例

本文整理匯總了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) {
開發者ID:CSCE499,項目名稱:PHPServer,代碼行數:31,代碼來源:indexSam.php

示例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);
}
開發者ID:ak8458,項目名稱:PHP-REST-Services,代碼行數:31,代碼來源:getMyEvents.php


注:本文中的DB_Functions::getAllEvents方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。