Page 1 of 1

How to use php program export mySQL Data to excel files...

Posted: Tue Oct 26, 2004 2:44 am
by kennie1112
Dear all,
Can you tell me...how to use php program export mySQL Data to excel files? (Save excel file into my PC)
I already use "INTO OUTFILE", but not work...
Please tell me why... :cry:

Error Message:

SQL-query :

SELECT uid, fullname
INTO OUTFILE 'c:/result.txt'
FIELDS TERMINATED BY ','
OPTIONALLY ENCLOSED BY '"'
LINES TERMINATED BY '\n'
FROM users
ORDER BY partnumber

MySQL said:


Access denied for user: 'sa6@localhost' (Using password: YES)
[php_man][/php_man]

Posted: Tue Oct 26, 2004 4:40 am
by swdev
Several things to check

1) Have you logged into MySQl with the correct username and password?
2) Have you used the correct database (i.e. issued a USE DATABASE
command)?
3) Does this user have the correct privileges to read from the 'users' table?
4) Does this user have the 'FILE_PRIV' privilege to write to the operating system?

Note, if you rename the file to 'c:/results.csv' then double-clicking on the file wiill automatically open the file in Excel.

Hope this helps

Posted: Wed Oct 27, 2004 10:04 pm
by kennie1112
Thanks! I know why porblem la...
Because I no call the database in module...so...hahaha)))
But thanks you tell me what problem. :D