ok
Direktori : /home/ngwcolle/www/ |
Current File : /home/ngwcolle/www/event.php |
<?php // include "header.php"; include "admin/includes/config.php"; // $sqlEvents = "SELECT id, category, title, content, start_date, end_date FROM tbl_calender"; // $resultset = mysqli_query($con, $sqlEvents) or die("database error:". mysqli_error($conn)); // $calendar = array(); // while( $rows = mysqli_fetch_assoc($resultset)){ // $start = $rows['start_date']; // $end = $rows['end_date']; // $calendar[] = array( // 'category' =>$rows['category'], // 'title' => $rows['title'], // "content" => $rows['content'], // 'start' => $start, // 'end' => $end // ); // } // $calendarData = array( // "success" => 1, // "result"=>$calendar); // echo json_encode($calendarData); $json = array(); $sqlQuery = "SELECT * FROM tbl_calender ORDER BY id"; $result = mysqli_query($con, $sqlQuery); $eventArray = array(); while ($row = mysqli_fetch_assoc($result)) { array_push($eventArray, $row); } mysqli_free_result($result); mysqli_close($con); echo json_encode($eventArray); ?>