seanpaul Posted January 21, 2004 Share Posted January 21, 2004 Hi All, I am having trouble trying to export the customers table from the mysql database, I'm exporting it in 'CSV data' format. I just get a whole load of errors. SQL-query : SHOW COLUMNS FROM FROM `itandtelecom` MySQL said: You have an error in your SQL syntax near 'FROM `itandtelecom`' at line 1 Also I get loads of 'Cannot add header information - headers already sent' . The table exports fine in mysql format but wont do CSV. Please help! :( Thanks Link to comment Share on other sites More sharing options...
peterr Posted January 21, 2004 Share Posted January 21, 2004 Hi, SQL-query : SHOW COLUMNS FROM FROM `itandtelecom` MySQL said: You have an error in your SQL syntax near 'FROM `itandtelecom`' at line 1 You have 2 "FROM" statements. Also I get loads of 'Cannot add header information - headers already sent' . The table exports fine in mysql format but wont do CSV. What tool are you using to do the export ? Peter Link to comment Share on other sites More sharing options...
seanpaul Posted January 21, 2004 Author Share Posted January 21, 2004 I'm using phpMyAdmin Link to comment Share on other sites More sharing options...
seanpaul Posted January 22, 2004 Author Share Posted January 22, 2004 can anyone help me with this, I realise I have a double 'from' in my sql query obviously this query is generated by phpMyAdmin. Could anyone help me with the correct sql for exporting in CSV format. Thanks Link to comment Share on other sites More sharing options...
peterr Posted January 22, 2004 Share Posted January 22, 2004 Hi, can anyone help me with this, I realise I have a double 'from' in my sql query obviously this query is generated by phpMyAdmin. Could anyone help me with the correct sql for exporting in CSV format. I'm using phpMyAdmin version 2.5.2 1. Select the 'osCommerce' db 2. Select the EXPORT tab 3. Either select the table name from the group box, or click the 'Select all' link, to select all the tables 4. There are 4 radio buttons for the output format. Select either "CSV for Ms Excel data" or "CSV Data" 5. Select the CSV options, from the group box at the right 6. Click the 'save as file' checkbox 7. Press the GO button Sorry I didn't reply to your other post, sometimes the notifications don't get emailed, or don't reach me, for some reason. Peter Link to comment Share on other sites More sharing options...
seanpaul Posted January 22, 2004 Author Share Posted January 22, 2004 Hi Peter, Thanks for the response I have followed the above steps. Its after that the error occurs. Link to comment Share on other sites More sharing options...
peterr Posted January 22, 2004 Share Posted January 22, 2004 Hi Adam, Thanks for the response I have followed the above steps. Its after that the error occurs. What version of phpMyAdmin are you using, and are you using it locally (your computer), or from a website ? Can you please post the entire error message. By Error, I assume you mean the original one Also I get loads of 'Cannot add header information - headers already sent' Taking a simplistic view, the headers have alreday been sent, so it doesn't want to add them again. I searched on Google for string "Cannot add header information - headers already sent", and got many hits. Some may help. Btw, when exporting in CSV format, the version of phpMyAdmin that I used doesn't output any header information, just raw data, with a semi colon as a delimiter, as follows: 1;"category_hardware.gif";"0";"1";"2004-01-12 21:42:50";NULL Peter Link to comment Share on other sites More sharing options...
seanpaul Posted January 23, 2004 Author Share Posted January 23, 2004 Hi, I apreciate your persistence on this one. The version I'm using is 2.5.0 (Maybe I should install newer version). OK heres the full error. Notice: Undefined variable: table in /home/virtual/site10/fst/var/www/html/phpMyAdmin-2.5.0-rc1/tbl_dump.php on line 358 Notice: Undefined variable: limit_from in /home/virtual/site10/fst/var/www/html/phpMyAdmin-2.5.0-rc1/tbl_dump.php on line 358 Notice: Undefined variable: limit_to in /home/virtual/site10/fst/var/www/html/phpMyAdmin-2.5.0-rc1/tbl_dump.php on line 358 Warning: Cannot add header information - headers already sent by (output started at /home/virtual/site10/fst/var/www/html/phpMyAdmin-2.5.0-rc1/tbl_dump.php:358) in /home/virtual/site10/fst/var/www/html/phpMyAdmin-2.5.0-rc1/libraries/ob.lib.php on line 65 Warning: Cannot add header information - headers already sent by (output started at /home/virtual/site10/fst/var/www/html/phpMyAdmin-2.5.0-rc1/tbl_dump.php:358) in /home/virtual/site10/fst/var/www/html/phpMyAdmin-2.5.0-rc1/libraries/header_http.inc.php on line 14 Warning: Cannot add header information - headers already sent by (output started at /home/virtual/site10/fst/var/www/html/phpMyAdmin-2.5.0-rc1/tbl_dump.php:358) in /home/virtual/site10/fst/var/www/html/phpMyAdmin-2.5.0-rc1/libraries/header_http.inc.php on line 15 Warning: Cannot add header information - headers already sent by (output started at /home/virtual/site10/fst/var/www/html/phpMyAdmin-2.5.0-rc1/tbl_dump.php:358) in /home/virtual/site10/fst/var/www/html/phpMyAdmin-2.5.0-rc1/libraries/header_http.inc.php on line 16 Warning: Cannot add header information - headers already sent by (output started at /home/virtual/site10/fst/var/www/html/phpMyAdmin-2.5.0-rc1/tbl_dump.php:358) in /home/virtual/site10/fst/var/www/html/phpMyAdmin-2.5.0-rc1/libraries/header_http.inc.php on line 17 Warning: Cannot add header information - headers already sent by (output started at /home/virtual/site10/fst/var/www/html/phpMyAdmin-2.5.0-rc1/tbl_dump.php:358) in /home/virtual/site10/fst/var/www/html/phpMyAdmin-2.5.0-rc1/libraries/header_http.inc.php on line 20 Database itandtelecom running on localhost Error SQL-query : SHOW COLUMNS FROM FROM `itandtelecom` MySQL said: You have an error in your SQL syntax near 'FROM `itandtelecom`' at line 1 Link to comment Share on other sites More sharing options...
seanpaul Posted January 23, 2004 Author Share Posted January 23, 2004 I'm not working localy, everything is on a remote server. :) Link to comment Share on other sites More sharing options...
peterr Posted January 23, 2004 Share Posted January 23, 2004 Hi, I did do a 'Google" on some of those error messages, are the version of phpMyAdmin was the same as yours. If possible, can you upgrade to a later version ? Or, just write some PHP code to do the export. Peter Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.