0

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.

1 Answer 1

1

You should have to use

      fputcsv();//Php Function 

For Further Guideline Please Read Php.net Manual http://php.net/manual/en/function.fputcsv.php

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.