<?php
require_once("template.php");

$id=$_SESSION['id'];

$requete="SELECT `date`, `aliment`,`type`,`calories`,`quantite`, `journal`.`id_aliment`,`journal`.`id` FROM `journal` JOIN `aliments` ON `journal`.`id_aliment`=`aliments`.`id_aliment` WHERE `journal`.`id`=".$id;
$result = $mysqli->query($requete);
$journal=$result->fetch_all();

reponse_json($journal);