I have a mysql database with a 'tblevel' table with a 'waktu' column with a varchar data type. and the column values are saved as follows:
30-01-2014 12:19:09
The value will be converted to a timestamp, because I have to do this to view the data on the chart, in this case I use Google data visualization,
Shortened code:
$result = mysql_query("SELECT TIMESTAMPDIFF(MINUTE,FROM_UNIX_TIMESTAMP(STR_TO_DATE(waktu, '%H:%i:%s %b %d, %Y')), now()) as waktu1,level,press FROM tblevel WHERE TIMESTAMPDIFF(MINUTE,FROM_UNIXTIME(waktu) , now()) < 120 Order By waktu");
hope someone helps fix the .thanks code
relates to Fixduino.
source
share