dpylt7626401 2013-12-26 05:35
浏览 46
已采纳

在php中导出CSV文件的mysql查询

i write simple Query in php for export data in CSV file but something is wrong with my Query of Syntex Error, can anyone tell me how to solve this? sorry for this liitle question, i m new in PHP.

$CSVQuery= "SELECT * FROM table INTO OUTFILE '/tmp/orders.csv' FIELDS TERMINATED BY ',' ENCLOSED BY '"' LINES TERMINATED BY '/n' ";

  • 写回答

2条回答 默认 最新

  • dsqtl335227 2013-12-26 05:39
    关注

    I think Query should be as below:

    $CSVQuery= "SELECT * INTO OUTFILE '/tmp/orders.csv' FIELDS TERMINATED BY ',' ENCLOSED BY '"' LINES TERMINATED BY '/n' FROM table ";

    For more details refer this link : MySQL Tutorial

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 halcon根据玻璃面板纹路取区域
  • ¥15 HFSS设计小型化180度耦合器
  • ¥15 使用CInternetSession,CHttpFile读取网页文件时有些电脑上会卡住怎么办?
  • ¥15 水下机器人的半物理仿真研究
  • ¥15 微服务假死,一段时间后自动恢复,如何排查处理
  • ¥50 webrtc-streamer TCP rtsp
  • ¥15 cplex运行后参数报错是为什么
  • ¥15 之前不小心删了pycharm的文件,后面重新安装之后软件打不开了
  • ¥15 vue3获取动态宽度,刷新后动态宽度值为0
  • ¥15 升腾威讯云桌面V2.0.0摄像头问题