Advertisement
Guest User

Untitled

a guest
May 31st, 2016
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1.  
  2. if($type == 'fetch')
  3. {
  4. $events = array();
  5. $query = mysqli_query($db, "SELECT * FROM Jazda") ;
  6. while($fetch = mysqli_fetch_array($query,MYSQLI_ASSOC))
  7. {
  8. $e = array();
  9.  
  10. $data = $fetch['data'] ;
  11. $start = $fetch['start'] ;
  12. $stop= $fetch['stop'] ;
  13. $idInstruktor = $fetch['Kursant_idKursant'];
  14. $instruktor = mysqli_query($db, "SELECT nazwisko FROM Instruktor WHERE idInstruktor = '$idInstruktor' ");
  15.  
  16.  
  17.  
  18. $e['id'] = $instruktor;
  19. $e['title'] = $fetch['idJazda'];
  20. $e['start'] = $data."T".$start;
  21. $e['end'] = $data."T".$stop;
  22.  
  23. array_push($events, $e);
  24. }
  25. echo json_encode($events);
  26. }
  27.  
  28.  
  29. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement