| | |
Website to CSV
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Aug 2007
Posts: 8
Reputation:
Solved Threads: 0
Can't you just use phpMyAdmin? It will export as csv, but why csv over sql? Are you just moving the site?
•
•
Join Date: Apr 2008
Posts: 10
Reputation:
Solved Threads: 1
I've used something like this:
I hope this helps.
PHP Syntax (Toggle Plain Text)
ini_set ('display_errors', 1); error_reporting (E_ALL & ~ E_NOTICE); ################################################################## $csv_output = "Last Name,First Name,Address 1,Address 2,City,State,Zip,Phone,Email,DOB,Member"; $csv_output .= "\n"; $result = mysql_query("SELECT * FROM members"); while($row = mysql_fetch_array($result)) { $csv_output .= "$row[last_name],$row[first_name],$row[address1],$row[address2],$row[city],$row[state],$row[zip],$row[phone],$row[email],$row[age],$row[member]\n"; } header("Content-type: application/vnd.ms-excel"); header("Content-disposition: attachment; filename=" . date("Y-m-d").".xls"); print $csv_output; exit;
I hope this helps.
•
•
Join Date: Jan 2009
Posts: 1
Reputation:
Solved Threads: 0
Hi: I have had great success building scripts over the last several years that convert websites to csv and other formats. A previous project mined data from over 300,000 pages. I would need more information to be sure I can help you, as much depends on the structure of the data on the original site. Please contact me if you would like to discuss this further.
![]() |
Similar Threads
- Porblem in UTF-8 support on CSV/EXCEL (PHP)
- Reading from a website (Python)
- Koriean text in CSV file... (Java)
- Open csv file, run code, save, quit, repeat 3000ish times. (Visual Basic 4 / 5 / 6)
- Problem After Opening File from Website (ASP.NET)
- how to delete extra commas on csv file with php (PHP)
- CSV file uploading into a MySQL Database? (PHP)
- encoding problem with csv/excel (PHP)
- Hi, How to access and read .csv files in C++ (C++)
Other Threads in the PHP Forum
- Previous Thread: urgent help...
- Next Thread: Multilanguage with PHP-MySQL
| Thread Tools | Search this Thread |
.htaccess ajax apache api archive array autocomplete beginner binary broken cakephp checkbox class cms code cron curl database date directory display download duplicates dynamic echo email emptydisplayvalue error errors execute explodefunction file files folder form forms function functions google href htaccess html image include insert integration ip java javascript joomla keywords limit link login loop mail menu mlm mod_rewrite multiple mysql oop oracle paypal pdf php problem query radio random recursion recursive regex remote script search server sessions shot sms soap source space sql subscription syntax system table tutorial tutorials update upload url validation validator variable video web xml youtube





