The database stores the date in timestamp format. I need to take from this date only hours: minutes: seconds and then present this data in seconds for the json object. I stopped at the fact that now there are string hours: minutes: seconds (in the screenshot), how to translate them into seconds?
<?php $con = mysql_connect("localhost","root","root"); if (!$con) die('Could not connect: ' . mysql_error()); mysql_select_db("triger", $con); $data = mysql_query("SELECT time(`time`) AS ts, value FROM triger1") or die ("Query error"); header("Content-type: text/json"); $V0 = array(); while($row = mysql_fetch_array($data)) { $V0[]= array( $row['ts'], (int) $row['value']); } mysql_close($con); echo json_encode( array($V0), JSON_NUMERIC_CHECK); ?> 