| | |
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 |
apache api array basic beginner binary broken cakephp checkbox class cms code computing confirm cron curl customizableitems database date delete display dynamic echo email error external file files filter folder form forms forum function functions gc_maxlifetime google headmethod host href htaccess html iframe image include insert ip javascript joomla limit link login mail malfunction memmory memory menu mlm multiple mysql navigation oop parsing paypal pdf php phpmysql problem query question radio random recursion remote script search select server sessions sms snippet soap source space sql syntax system table thesishelp trouble tutorial update upload url validator variable video web xml youtube





