<? $sql="SELECT member_id,income_type,total_amount FROM pay_count INTO OUTFILE 'order.xls' FIELDS TERMINATED BY '\t' ENCLOSED BY '|' LINES TERMINATED BY '\n'"; $omu=mysql_query($sql)or die('Error, Please contact to technical department'); echo "created"; ?> Code (markup): I am using obove code to output file into Excel. It works fine when i test it locally and a file order.xls is created into mysql/data/dbname directory But whats the error while using online and where the new file will be created.
Hmm... You should go to the directory where the database is."DATABASE_DIRECTORY", *nix: /var/lib/mysql/DATABASE_NAME windowsATABASE_DIRECTORY Hope it can help you.By the way you also can change the SQL: yours: $sql="SELECT member_id,income_type,total_amount FROM pay_count INTO OUTFILE 'order.xls' FIELDS TERMINATED BY '\t' ENCLOSED BY '|' LINES TERMINATED BY '\n'"; HTML: mine: $sql="SELECT member_id,income_type,total_amount FROM pay_count INTO OUTFILE '/tmp/order.xls(where do you want to save)' FIELDS TERMINATED BY '\t' ENCLOSED BY '|' LINES TERMINATED BY '\n'";
It seems that "online" your data base does not have default directory. Try to set a valid path on your online server.
Please tell me where to find database files in case of online. i searched all the directory on my web server but didnt find. In case of locally i know it.