Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php $mysqli = new mysqli('localhost','root','xxxx','xxxx');
- $myArray = array();
- if ($result = $mysqli->query("SELECT CONCAT(Datum , ' ', Tijd) as Datum, KleurL FROM metingen order by Datum ASC limit 20")) {
- $tempArray = array();
- while($row = $result->fetch_object()) {
- $tempArray = $row;
- array_push($myArray, $tempArray);
- }
- echo json_encode($myArray,JSON_NUMERIC_CHECK);
- $fp = fopen('resultsv2.json', 'w');
- fwrite($fp, json_encode($myArray,JSON_NUMERIC_CHECK));
- fclose($fp);
- }
- $result->close();
- $mysqli->close(); ?>
- [{"Datum":"17-01-2019 10:31:39","KleurL":17.68},{"Datum":"17-01-2019 11:10:59","KleurL":71.76},{"Datum":"18-01-2019 08:40:41","KleurL":70.7},{"Datum":"18-01-2019 10:30:01","KleurL":71.03},{"Datum":"18-01-2019 12:05:46","KleurL":70.56},{"Datum":"18-01-2019 14:31:58","KleurL":16.2}]
- [
- [
- 17.68,
- 17-01-2019 10:31:39
- ],
- [
- 18.11,
- 17-01-2019 11:15:20
- ]
Add Comment
Please, Sign In to add comment