I am working on php-based website.
What I want to do is in php file create a html page with a button and textfield for date that generates CSV file from database.
For example, I have first_name, last_name, phone and date columns.
My sql code will be:
SELECT first_name, last_name, phone
FROM people
WHERE date <= (input from users);
Should I create two php files, one for creating a html page and one for generating CSV file? or would it be possible in one php file?
If it is possible, could you give me any example of code with my database example above?
Thanks, in advance.