MySQL version 4.0.27-standard
I want to write selected columns from a table to a file in my web site
I've written the following SQL statement, but I'm unsure about the syntax

SELECT event, location, eventTime, eventDate
FROM commingEvents
INTO OUTFILE '/home/_wmevents/public_html/wmEvents.csv'
FIELDS TERMINATED BY ','
ENCLOSED BY '\"'
LINES TERMINATED BY '\n'

any help correcting any errors would be appreciated

Recommended Answers

All 2 Replies

MySQL version 4.0.27-standard
I want to write selected columns from a table to a file in my web site
I've written the following SQL statement, but I'm unsure about the syntax

SELECT event, location, eventTime, eventDate
FROM commingEvents
INTO OUTFILE '/home/_wmevents/public_html/wmEvents.csv'
FIELDS TERMINATED BY ','
ENCLOSED BY '\"'
LINES TERMINATED BY '\n'

any help correcting any errors would be appreciated

Put the FROM after the LINES TERMINATED BY, and you should be all good

Thank You

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.