php - Retrieve data from database in specific interval into a file -
in database, have stored data in 1 second interval, want retrieve stored data file in particular interval entered user.
data below:
timestamp values 1436846660 10 1436846661 10 1436846662 10 1436846663 10 1436846664 10
for user entered interval 2
, expected result :
timestamp values 1436846660 10 1436846662 10 1436846664 10
i using following command data starttime
stoptime
select `values` outfile 'filepath' fields terminated '' lines terminated '\n' tablename tablename.timestamp >=starttime , tablename.timestamp <=stoptime;
so, how should modify code include data between starttime
, stoptime
particular interval. please provide me solution.
this code worked me . interval : 2
select `value` -- ,`timestamp` outfile 'test.csv' fields terminated '' lines terminated '\n' `timestamp_table` `timestamp` >= 1436846660 , `timestamp` <= 1436846670 , mod( `timestamp` ,2) = 0
in last line , change 2 whatever interval need .
Comments
Post a Comment