» Quick Links
You can make money on these forums
We Share profits with you
Google
Google Adsense
Google Adwords
YPN
Yahoo
MSN Search
Web Directories
Web Hosting
Web Hosting Offers
Hosting News
Suggestions
Link Building
Domain Names
PHP Forums
MySQL Forums
» More Links
OSP News
Reseller Hosting
Shared Hosting
Dedicated Servers
Google Adsense
Search Engine Marketing
Link Development
Affiliate Marketing


» Advertising
Multiple DC PR Check

Free SEO Tools


Go Back   Webmaster Forums > Website Developement / Programming > MySQL Forums

MySQL Forums Share Your Ideas and Tips about MYSQL. Ask questions about MYSQL. Table Design and Much More...

Reply
 
Thread Tools Display Modes
  #1  
Old 08-29-2006, 03:17 PM
walsh walsh is offline
OSP Starters
 
Join Date: Aug 2006
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
walsh is on a distinguished road
Default Export to CSV problem Export to CSV problem

I already have this query, works fine.

Code:
select p.sname, c.cfirst, c.clast,c.cstreetaddy,c.ccity,c.cstate,c.czip, c.cemail from contact c join vseat v join pseat p where v.cid=c.cid and v.pid = p.pid and v.eid=237 and v.status=3;

Now I want to export as CSV. So I search for url sql.com and it has this example:

Code:
SELECT a,b,a+b INTO OUTFILE '/tmp/result.txt'
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
LINES TERMINATED BY '\n'
FROM test_table;

Oh Perfect. thats just what I want. So here is my jazzed up query:

Code:
select p.sname, c.cfirst, c.clast,c.cstreetaddy,c.ccity,c.cstate,c.czip, c.cemail into outfile
'/tmp/event237.csv' fields terminated by ',' optionally enclosed by '"' lines terminated by '\n' from contact c join vseat v join pseat p where v.cid=c.cid and v.pid = p.pid and v.eid=237 and v.status=3;

And what -- This message may have been cut off and the rest will only be shown to members. To become a member, click here --
Reply With Quote
Revenue Sharing Ads ( ?):
  #2  
Old 08-29-2006, 03:20 PM
nathan nathan is offline
OSP Starters
 
Join Date: Mar 2006
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
nathan is on a distinguished road
Lightbulb

FYI your joins are incorrect, you use the JOIN keyword without the ON keyword

this may fail to work in later versions
hope I was of little help -- This message may have been cut off and the rest will only be shown to members. To become a member, click here --
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
stored procedure creating problem? Wumchi MySQL Forums 1 11-23-2006 04:57 AM
problem with stored procedures?? Vanis MySQL Forums 1 10-23-2006 05:48 AM
Backspace key problem in MSN chat only! rozntom General Talk 1 09-04-2006 05:54 AM
mailing list problem jolly PHP Programming and Tips 1 08-12-2006 11:36 AM
Problem in Building my own Forum johny MySQL Forums 1 12-07-2005 07:40 AM


All times are GMT. The time now is 05:37 AM.