Home > Database > Mysql Tutorial > body text

mysql导出xls文件方法

WBOY
Release: 2016-06-07 17:51:55
Original
1178 people have browsed it

这里介绍了一种是利用php结合mysql的outfile成.xls文件,另一种是利用cmd命令下直接导出.xls文件的方法。

在中操作

 代码如下 复制代码

include('db/db.php');  //包含连库类
$db = new db();
$result = _query(' * from market_sig into outfile "d:product3.xls";');
var_dump($result);
?>

在cmd方式下操作

 代码如下 复制代码

mysql   -uroot   -p   -e   "select   *   from   test.table2 "   >   d:a.xsl

总结:前一种方法需要会php人员能操作,后一种只要在mysql cmd命令下就可以方法操作了,

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!