Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- mysql_connect(deleted);
- mysql_select_db("DB1367141")
- $day = date("d");
- $month = date("m");
- $year = date("Y");
- $result = mysql_query("SELECT * FROM entries WHERE day = '$day' AND month = '$month' AND year = '$year' ORDER BY hour DESC, minute");
- $array = {};
- while($obj = mysql_fetch_object($result))
- {
- if($obj->hour != "--")
- $hour = splitf("%02d", $obj->hour);
- else
- $hour = $obj->hour;
- if($obj->minute != "--")
- $minute = splitf("%02d", $obj->minute)
- else
- $minute = $obj->minute;
- array_push($array, {"hour":$hour, "minute":$minute, "text":$obj->tex});
- }
- var_dump($array);
- echo json_encode($array);
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement