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

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

Rendering JButton to get the JCheckBox behavior in a JTable by using images does not update my table -