Table of Contents
PHP导入excel数据到MYSQL,php导入excelmysql
Home php教程 php手册 PHP导入excel数据到MYSQL,php导入excelmysql

PHP导入excel数据到MYSQL,php导入excelmysql

Jun 13, 2016 am 08:40 AM
phpexcel

PHP导入excel数据到MYSQL,php导入excelmysql

这里介绍一个直接将excel文件导入mysql的例子。我花了一晚上的时间测试,无论导入简繁体都不会出现乱码,非常好用。
PHP-ExcelReader,下载地址: http://sourceforge.net/projects/phpexcelreader
说明: 
测试环境:MYSQL数据库采用utf8编码.导入EXCEL文档是xls格式,经过测试,xlsx 格式[excel 2007]也OK. 
文中红色标注为需要注意的地方,请替换成你配置好的数据,如数据库配置等。运行http://localost/test.php实现导入。 
以下是我贴出的详细代码,其中test.php为我写的测试文件,reader.php和oleread.inc文件是从上面提供的网址中下载的。 
1. test.php

代码如下:

<?<span>php
</span><span>require_once</span> './includes/reader.php'<span>; 
</span><span>//</span><span> ExcelFile($filename, $encoding); </span>
<span>$data</span> = <span>new</span><span> Spreadsheet_Excel_Reader(); 
</span><span>//</span><span> Set output Encoding. </span>
<span>$data</span>->setOutputEncoding('gbk'<span>); 
</span><span>//</span><span>&rdquo;data.xls&rdquo;是指要导入到mysql中的excel文件 </span>
<span>$data</span>->read('date.xls'<span>); 
@ </span><span>$db</span> = <span>mysql_connect</span>('localhost', 'root', '1234'<span>) or 
</span><span>die</span>("Could not connect to database.");<span>//</span><span>连接数据库 </span>
<span>mysql_query</span>("set names 'gbk'");<span>//</span><span>输出中文 </span>
<span>mysql_select_db</span>('wenhuaedu'); <span>//</span><span>选择数据库 </span>
<span>error_reporting</span>(<span>E_ALL</span> ^ <span>E_NOTICE</span><span>); 
</span><span>for</span> (<span>$i</span> = 1; <span>$i</span> <= <span>$data</span>->sheets[0]['numRows']; <span>$i</span>++<span>) { 
</span><span>//</span><span>以下注释的for循环打印excel表数据 </span><span>
/*</span><span> 
for ($j = 1; $j <= $data->sheets[0]['numCols']; $j++) { 
echo """.$data->sheets[0]['cells'][$i][$j]."","; 
} 
echo "n"; 
</span><span>*/</span> <span>/*</span><span> 何问起 hovertree.com </span><span>*/</span>
<span>//</span><span>以下代码是将excel表数据【3个字段】插入到mysql中,根据你的excel表字段的多少,改写以下代码吧! </span>
<span>$sql</span> = "INSERT INTO test VALUES('". 
<span>$data</span>->sheets[0]['cells'][<span>$i</span>][1]."','". 
<span>$data</span>->sheets[0]['cells'][<span>$i</span>][2]."','". 
<span>$data</span>->sheets[0]['cells'][<span>$i</span>][3]."')"<span>; 
</span><span>echo</span> <span>$sql</span>.'<br />'<span>; 
</span><span>$res</span> = <span>mysql_query</span>(<span>$sql</span><span>); 
</span>?>
Copy after login

包含的文件
OLERead.php

<?<span>php 
</span><span>define</span>('NUM_BIG_BLOCK_DEPOT_BLOCKS_POS', 0x2c<span>); 
</span><span>define</span>('SMALL_BLOCK_DEPOT_BLOCK_POS', 0x3c<span>); 
</span><span>define</span>('ROOT_START_BLOCK_POS', 0x30<span>); 
</span><span>define</span>('BIG_BLOCK_SIZE', 0x200<span>); 
</span><span>define</span>('SMALL_BLOCK_SIZE', 0x40<span>); 
</span><span>define</span>('EXTENSION_BLOCK_POS', 0x44<span>); 
</span><span>define</span>('NUM_EXTENSION_BLOCK_POS', 0x48<span>); 
</span><span>define</span>('PROPERTY_STORAGE_BLOCK_SIZE', 0x80<span>); 
</span><span>define</span>('BIG_BLOCK_DEPOT_BLOCKS_POS', 0x4c<span>); 
</span><span>define</span>('SMALL_BLOCK_THRESHOLD', 0x1000<span>); 
</span><span>//</span><span> property storage offsets </span>
<span>define</span>('SIZE_OF_NAME_POS', 0x40<span>); 
</span><span>define</span>('TYPE_POS', 0x42<span>); 
</span><span>define</span>('START_BLOCK_POS', 0x74<span>); 
</span><span>define</span>('SIZE_POS', 0x78<span>); 
</span><span>define</span>('IDENTIFIER_OLE', <span>pack</span>("CCCCCCCC",0xd0,0xcf,0x11,0xe0,0xa1,0xb1,0x1a,0xe1<span>)); 
</span><span>//</span><span>echo 'ROOT_START_BLOCK_POS = '.ROOT_START_BLOCK_POS."\n"; 
//echo bin2hex($data[ROOT_START_BLOCK_POS])."\n"; 
//echo "a="; 
//echo $data[ROOT_START_BLOCK_POS]; 
//function log </span>
<span>function</span> GetInt4d(<span>$data</span>, <span>$pos</span><span>) 
{ 
</span><span>$value</span> = <span>ord</span>(<span>$data</span>[<span>$pos</span>]) | (<span>ord</span>(<span>$data</span>[<span>$pos</span>+1]) << 8) | (<span>ord</span>(<span>$data</span>[<span>$pos</span>+2]) << 16) | (<span>ord</span>(<span>$data</span>[<span>$pos</span>+3]) << 24<span>); 
</span><span>if</span> (<span>$value</span>>=4294967294<span>) 
{ 
</span><span>$value</span>=-2<span>; 
} 
</span><span>return</span> <span>$value</span><span>; 
} 
</span><span>class</span><span> OLERead { 
</span><span>var</span> <span>$data</span> = ''<span>; 
</span><span>function</span><span> OLERead(){ 
} 
</span><span>function</span> read(<span>$sFileName</span><span>){ 
</span><span>//</span><span> check if file exist and is readable (Darko Miljanovic) </span>
<span>if</span>(!<span>is_readable</span>(<span>$sFileName</span><span>)) { 
</span><span>$this</span>->error = 1<span>; 
</span><span>return</span> <span>false</span><span>; 
} 
</span><span>$this</span>->data = @<span>file_get_contents</span>(<span>$sFileName</span><span>); 
</span><span>if</span> (!<span>$this</span>-><span>data) { 
</span><span>$this</span>->error = 1<span>; 
</span><span>return</span> <span>false</span><span>; 
} 
</span><span>//</span><span>echo IDENTIFIER_OLE; 
//echo 'start'; </span>
<span>if</span> (<span>substr</span>(<span>$this</span>->data, 0, 8) !=<span> IDENTIFIER_OLE) { 
</span><span>$this</span>->error = 1<span>; 
</span><span>return</span> <span>false</span><span>; 
} 
</span><span>$this</span>->numBigBlockDepotBlocks = GetInt4d(<span>$this</span>->data,<span> NUM_BIG_BLOCK_DEPOT_BLOCKS_POS); 
</span><span>$this</span>->sbdStartBlock = GetInt4d(<span>$this</span>->data,<span> SMALL_BLOCK_DEPOT_BLOCK_POS); 
</span><span>$this</span>->rootStartBlock = GetInt4d(<span>$this</span>->data,<span> ROOT_START_BLOCK_POS); 
</span><span>$this</span>->extensionBlock = GetInt4d(<span>$this</span>->data,<span> EXTENSION_BLOCK_POS); 
</span><span>$this</span>->numExtensionBlocks = GetInt4d(<span>$this</span>->data,<span> NUM_EXTENSION_BLOCK_POS); 
</span><span>/*</span><span> 
echo $this->numBigBlockDepotBlocks." "; 
echo $this->sbdStartBlock." "; 
echo $this->rootStartBlock." "; 
echo $this->extensionBlock." "; 
echo $this->numExtensionBlocks." "; 
</span><span>*/</span> 
<span>//</span><span>echo "sbdStartBlock = $this->sbdStartBlock\n"; </span>
<span>$bigBlockDepotBlocks</span> = <span>array</span><span>(); 
</span><span>$pos</span> =<span> BIG_BLOCK_DEPOT_BLOCKS_POS; 
</span><span>//</span><span> echo "pos = $pos"; </span>
<span>$bbdBlocks</span> = <span>$this</span>-><span>numBigBlockDepotBlocks; 
</span><span>if</span> (<span>$this</span>->numExtensionBlocks != 0<span>) { 
</span><span>$bbdBlocks</span> = (BIG_BLOCK_SIZE - BIG_BLOCK_DEPOT_BLOCKS_POS)/4<span>; 
} 
</span><span>for</span> (<span>$i</span> = 0; <span>$i</span> < <span>$bbdBlocks</span>; <span>$i</span>++<span>) { 
</span><span>$bigBlockDepotBlocks</span>[<span>$i</span>] = GetInt4d(<span>$this</span>->data, <span>$pos</span><span>); 
</span><span>$pos</span> += 4<span>; 
} 
</span><span>for</span> (<span>$j</span> = 0; <span>$j</span> < <span>$this</span>->numExtensionBlocks; <span>$j</span>++<span>) { 
</span><span>$pos</span> = (<span>$this</span>->extensionBlock + 1) *<span> BIG_BLOCK_SIZE; 
</span><span>$blocksToRead</span> = <span>min</span>(<span>$this</span>->numBigBlockDepotBlocks - <span>$bbdBlocks</span>, BIG_BLOCK_SIZE / 4 - 1<span>); 
</span><span>for</span> (<span>$i</span> = <span>$bbdBlocks</span>; <span>$i</span> < <span>$bbdBlocks</span> + <span>$blocksToRead</span>; <span>$i</span>++<span>) { 
</span><span>$bigBlockDepotBlocks</span>[<span>$i</span>] = GetInt4d(<span>$this</span>->data, <span>$pos</span><span>); 
</span><span>$pos</span> += 4<span>; 
} 
</span><span>$bbdBlocks</span> += <span>$blocksToRead</span><span>; 
</span><span>if</span> (<span>$bbdBlocks</span> < <span>$this</span>-><span>numBigBlockDepotBlocks) { 
</span><span>$this</span>->extensionBlock = GetInt4d(<span>$this</span>->data, <span>$pos</span><span>); 
} 
} </span><span>/*</span><span> 何问起 hovertree.com </span><span>*/</span>
<span>//</span><span> var_dump($bigBlockDepotBlocks); 
// readBigBlockDepot </span>
<span>$pos</span> = 0<span>; 
</span><span>$index</span> = 0<span>; 
</span><span>$this</span>->bigBlockChain = <span>array</span><span>(); 
</span><span>for</span> (<span>$i</span> = 0; <span>$i</span> < <span>$this</span>->numBigBlockDepotBlocks; <span>$i</span>++<span>) { 
</span><span>$pos</span> = (<span>$bigBlockDepotBlocks</span>[<span>$i</span>] + 1) *<span> BIG_BLOCK_SIZE; 
</span><span>//</span><span>echo "pos = $pos"; </span>
<span>for</span> (<span>$j</span> = 0 ; <span>$j</span> < BIG_BLOCK_SIZE / 4; <span>$j</span>++<span>) { 
</span><span>$this</span>->bigBlockChain[<span>$index</span>] = GetInt4d(<span>$this</span>->data, <span>$pos</span><span>); 
</span><span>$pos</span> += 4<span> ; 
</span><span>$index</span>++<span>; 
} 
} 
</span><span>//</span><span>var_dump($this->bigBlockChain); 
//echo '=====2'; 
// readSmallBlockDepot(); </span>
<span>$pos</span> = 0<span>; 
</span><span>$index</span> = 0<span>; 
</span><span>$sbdBlock</span> = <span>$this</span>-><span>sbdStartBlock; 
</span><span>$this</span>->smallBlockChain = <span>array</span><span>(); 
</span><span>while</span> (<span>$sbdBlock</span> != -2<span>) { 
</span><span>$pos</span> = (<span>$sbdBlock</span> + 1) *<span> BIG_BLOCK_SIZE; 
</span><span>for</span> (<span>$j</span> = 0; <span>$j</span> < BIG_BLOCK_SIZE / 4; <span>$j</span>++<span>) { 
</span><span>$this</span>->smallBlockChain[<span>$index</span>] = GetInt4d(<span>$this</span>->data, <span>$pos</span><span>); 
</span><span>$pos</span> += 4<span>; 
</span><span>$index</span>++<span>; 
} 
</span><span>$sbdBlock</span> = <span>$this</span>->bigBlockChain[<span>$sbdBlock</span><span>]; 
} 
</span><span>//</span><span> readData(rootStartBlock) </span>
<span>$block</span> = <span>$this</span>-><span>rootStartBlock; 
</span><span>$pos</span> = 0<span>; 
</span><span>$this</span>->entry = <span>$this</span>->__readData(<span>$block</span><span>); 
</span><span>/*</span><span> 
while ($block != -2) { 
$pos = ($block + 1) * BIG_BLOCK_SIZE; 
$this->entry = $this->entry.substr($this->data, $pos, BIG_BLOCK_SIZE); 
$block = $this->bigBlockChain[$block]; 
} 
</span><span>*/</span> 
<span>//</span><span>echo '==='.$this->entry."==="; </span>
<span>$this</span>-><span>__readPropertySets(); 
} 
</span><span>function</span> __readData(<span>$bl</span><span>) { 
</span><span>$block</span> = <span>$bl</span><span>; 
</span><span>$pos</span> = 0<span>; 
</span><span>$data</span> = ''<span>; 
</span><span>while</span> (<span>$block</span> != -2<span>) { 
</span><span>$pos</span> = (<span>$block</span> + 1) *<span> BIG_BLOCK_SIZE; 
</span><span>$data</span> = <span>$data</span>.<span>substr</span>(<span>$this</span>->data, <span>$pos</span>,<span> BIG_BLOCK_SIZE); 
</span><span>//</span><span>echo "pos = $pos data=$data\n"; </span>
<span>$block</span> = <span>$this</span>->bigBlockChain[<span>$block</span><span>]; 
} 
</span><span>return</span> <span>$data</span><span>; 
} 
</span><span>function</span><span> __readPropertySets(){ 
</span><span>$offset</span> = 0<span>; 
</span><span>//</span><span>var_dump($this->entry); </span>
<span>while</span> (<span>$offset</span> < <span>strlen</span>(<span>$this</span>-><span>entry)) { 
</span><span>$d</span> = <span>substr</span>(<span>$this</span>->entry, <span>$offset</span>,<span> PROPERTY_STORAGE_BLOCK_SIZE); 
</span><span>$nameSize</span> = <span>ord</span>(<span>$d</span>[SIZE_OF_NAME_POS]) | (<span>ord</span>(<span>$d</span>[SIZE_OF_NAME_POS+1]) << 8<span>); 
</span><span>$type</span> = <span>ord</span>(<span>$d</span><span>[TYPE_POS]); 
</span><span>//</span><span>$maxBlock = strlen($d) / BIG_BLOCK_SIZE - 1; </span>
<span>$startBlock</span> = GetInt4d(<span>$d</span>,<span> START_BLOCK_POS); 
</span><span>$size</span> = GetInt4d(<span>$d</span>,<span> SIZE_POS); 
</span><span>$name</span> = ''<span>; 
</span><span>for</span> (<span>$i</span> = 0; <span>$i</span> < <span>$nameSize</span> ; <span>$i</span>++<span>) { 
</span><span>$name</span> .= <span>$d</span>[<span>$i</span><span>]; 
} 
</span><span>$name</span> = <span>str_replace</span>("\x00", "", <span>$name</span><span>); 
</span><span>$this</span>->props[] = <span>array</span><span> ( 
</span>'name' => <span>$name</span>, 
'type' => <span>$type</span>, 
'startBlock' => <span>$startBlock</span>, 
'size' => <span>$size</span><span>); 
</span><span>if</span> ((<span>$name</span> == "Workbook") || (<span>$name</span> == "Book"<span>)) { 
</span><span>$this</span>->wrkbook = <span>count</span>(<span>$this</span>->props) - 1<span>; 
} 
</span><span>if</span> (<span>$name</span> == "Root Entry"<span>) { 
</span><span>$this</span>->rootentry = <span>count</span>(<span>$this</span>->props) - 1<span>; 
} 
</span><span>//</span><span>echo "name ==$name=\n"; </span>
<span>$offset</span> +=<span> PROPERTY_STORAGE_BLOCK_SIZE; 
} 
} 
</span><span>function</span><span> getWorkBook(){ 
</span><span>if</span> (<span>$this</span>->props[<span>$this</span>->wrkbook]['size'] <<span> SMALL_BLOCK_THRESHOLD){ 
</span><span>//</span><span> getSmallBlockStream(PropertyStorage ps) </span>
<span>$rootdata</span> = <span>$this</span>->__readData(<span>$this</span>->props[<span>$this</span>->rootentry]['startBlock'<span>]); 
</span><span>$streamData</span> = ''<span>; 
</span><span>$block</span> = <span>$this</span>->props[<span>$this</span>->wrkbook]['startBlock'<span>]; 
</span><span>//</span><span>$count = 0; </span>
<span>$pos</span> = 0<span>; 
</span><span>while</span> (<span>$block</span> != -2<span>) { 
</span><span>$pos</span> = <span>$block</span> *<span> SMALL_BLOCK_SIZE; 
</span><span>$streamData</span> .= <span>substr</span>(<span>$rootdata</span>, <span>$pos</span>,<span> SMALL_BLOCK_SIZE); 
</span><span>$block</span> = <span>$this</span>->smallBlockChain[<span>$block</span><span>]; 
} 
</span><span>return</span> <span>$streamData</span><span>; 
}</span><span>else</span><span>{ 
</span><span>$numBlocks</span> = <span>$this</span>->props[<span>$this</span>->wrkbook]['size'] /<span> BIG_BLOCK_SIZE; 
</span><span>if</span> (<span>$this</span>->props[<span>$this</span>->wrkbook]['size'] % BIG_BLOCK_SIZE != 0<span>) { 
</span><span>$numBlocks</span>++<span>; 
} 
</span><span>if</span> (<span>$numBlocks</span> == 0) <span>return</span> ''<span>; 
</span><span>//</span><span>echo "numBlocks = $numBlocks\n"; 
//byte[] streamData = new byte[numBlocks * BIG_BLOCK_SIZE]; 
//print_r($this->wrkbook); </span>
<span>$streamData</span> = ''<span>; 
</span><span>$block</span> = <span>$this</span>->props[<span>$this</span>->wrkbook]['startBlock'<span>]; 
</span><span>//</span><span>$count = 0; </span>
<span>$pos</span> = 0<span>; 
</span><span>//</span><span>echo "block = $block"; </span>
<span>while</span> (<span>$block</span> != -2<span>) { 
</span><span>$pos</span> = (<span>$block</span> + 1) *<span> BIG_BLOCK_SIZE; 
</span><span>$streamData</span> .= <span>substr</span>(<span>$this</span>->data, <span>$pos</span>,<span> BIG_BLOCK_SIZE); 
</span><span>$block</span> = <span>$this</span>->bigBlockChain[<span>$block</span><span>]; 
} 
</span><span>//</span><span>echo 'stream'.$streamData; </span>
<span>return</span> <span>$streamData</span><span>; 
} 
} 
} 
</span>?>
Copy after login

参考:http://hovertree.com/h/bjaf/to3l3tjm.htm

http://www.cnblogs.com/roucheng/p/phpmysql.html

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

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
WWE 2K25: How To Unlock Everything In MyRise
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Complete Guide: How to process Excel files using php extension PHPExcel Complete Guide: How to process Excel files using php extension PHPExcel Jul 28, 2023 pm 10:01 PM

Complete Guide: How to Process Excel Files Using PHP Extension PHPExcel Introduction: Excel files are often used as a common format for data storage and exchange when processing large amounts of data and statistical analysis. Using the PHP extension PHPExcel, we can easily read, write and modify Excel files to effectively process Excel data. This article will introduce how to use the PHP extension PHPExcel to process Excel files and provide code examples. 1. Install PHPExc

PHP development: Use PHPExcel to process Excel files PHP development: Use PHPExcel to process Excel files Jun 15, 2023 pm 03:45 PM

With the advent of the digital age, data has become the most important part of our daily lives and work, and Excel files have become one of the important tools for data processing. I believe that many PHP developers will often encounter the use of Excel files for data processing and operations at work. This article will introduce you to the methods and precautions for using the PHPExcel library to process Excel files. What is PHPExcel? PHPExcel is a PHP class

How to use phpexcel to convert Excel files to CSV files and open them How to use phpexcel to convert Excel files to CSV files and open them Mar 27, 2023 pm 04:16 PM

​PHPEXCEL is an excellent PHP class library for reading and writing Excel files. It provides a very sufficient API that allows us to use PHP to read and write Excel files. Sometimes, we need to convert Excel files into CSV files for use on some occasions. So, this article mainly describes how to use the PHPEXCEL class library to convert Excel files into CSV files and open them.

Why phpexcel has become the focus of PHP developers Why phpexcel has become the focus of PHP developers Mar 27, 2023 pm 06:15 PM

PHPExcel is an open source PHP library for processing Microsoft Excel files. It can read, create, modify and save Excel files. It is a powerful and highly customizable tool that can be used to handle tasks such as data analysis, report generation, data import and export, etc. In this article, we will introduce why PHPExcel has become the focus of PHP developers.

How to use PHPExcel to process Excel files? How to use PHPExcel to process Excel files? Jun 01, 2023 pm 02:01 PM

PHPExcel is an open source PHP library for processing Microsoft Excel (.xls and .xlsx) files. It can read, write and operate Excel files, and provides a wealth of functions and methods. Using the PHPExcel library in PHP projects, you can quickly and easily process Excel files and implement functions such as data import, export and data processing. This article will introduce how to use PHPExcel to process Excel files. 1. To install PHPExcel, use

Create Excel files using PHP and PHPExcel Create Excel files using PHP and PHPExcel May 11, 2023 am 08:40 AM

In today's era of rapid information transfer, data processing and storage have become increasingly important. The use of Excel tables is the first choice for many people because Excel tables can integrate various data and can be easily analyzed and processed. In order to complete the creation of Excel tables more efficiently, we can use two powerful tools, PHP and PHPExcel. In this article, we will introduce how to create Excel files using PHP and PHPExcel. 1. Install PHPExcel first

PHP development tips: How to use PHPExcel and PHPExcel_IOFactory to operate MySQL database PHP development tips: How to use PHPExcel and PHPExcel_IOFactory to operate MySQL database Jul 02, 2023 pm 02:28 PM

PHP development tips: How to use PHPExcel and PHPExcel_IOFactory to operate MySQL database Overview: In web development, processing Excel files is a common and important task. PHPExcel is a powerful and easy-to-use PHP library that can help us read and write Excel files. This article will introduce how to use PHPExcel and PHPExcel_IOFactory libraries to operate MySQL database. step 1

PHP development skills: How to use PHPExcel to operate MySQL database PHP development skills: How to use PHPExcel to operate MySQL database Jul 02, 2023 pm 12:21 PM

PHP development skills: How to use PHPExcel to operate MySQL database. With the booming development of the Internet, a large amount of data is stored in the database, and operations such as import, export, and processing are required. In PHP development, PHPExcel is a powerful library that can simplify the interaction with Excel files and realize the import and export of data. This article will introduce how to use PHPExcel to operate the MySQL database and implement data import and export functions. Installation and configuration of PHPExcel

See all articles