My favorites | Sign in
Project Home Issues
New issue   Search
for
  Advanced search   Search tips   Subscriptions

Issue 1183 attachment: json-events.txt (546 bytes)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
<?php
include ('scripts/php/connectdb.php');
$mysqli = new mysqli('localhost', '$username', '$password', '$db');
$result = $mysqli->query("SELECT * FROM agenda");
$nr = mysqli_num_rows($result);
$json=array();
while($row = $result->fetch_assoc())
{
$title=$row['evento'];
$data=$row['dataora'];
$id=$row['ID'];
$dataarr=explode('/',$data);
$giorno=$dataarr[0];
$mese=$dataarr[1];
$anno=$dataarr[2];
$data="$anno - $mese - $giorno";
$json[]=array('id' => $id, 'title'=> $title,'start'=> $data );
}
echo json_encode($json);
?>
Powered by Google Project Hosting