-
php导入大量数据到mysql性能优化
[PHP教程] 2022-02-17 13:05:10 65人阅读
在mysql中我们结合php把一些文件导入到mysql中,下面我来分享我对15000条记录进行导入时分析与优化,各位朋友可参考. 之前有几篇文章,说了最近tiandi在帮朋友做一个小项目,用于统计电话号码的,每次按需求从数据库里...[详细]
-
PHP利用curl实现get与POST提交数据
[PHP教程] 2022-02-17 13:04:55 122人阅读
curl实现get提交数据,代码如下: // 初始化一个 cURL 对象 $curl = curl_init(); // 设置你需要抓取的URL curl_setopt($curl, CURLOPT_URL, http://www.Cuoxin.com); // 设置header, 最后一个参数是0表示返回值不带有...[详细]
-
PHP mysql事务回滚操作实例
[PHP教程] 2022-02-17 13:04:38 86人阅读
本文章来给大家介绍一个PHP mysql事务回滚操作实例,有需要了解事物回滚的朋友可参考,操作方法很简单. MYSQL中只有INNODB和BDB类型的数据表才能支持事务处理,其他的类型是不支持的,代码如下: public function insertU...[详细]
-
php备份mysql实例程序
[PHP教程] 2022-02-17 13:04:20 62人阅读
php备份mysql我们需借助于系统的计划任务功能,下面我来介绍在linux中php备份mysql实例方法. 将所有备份文件备份到指定的目录,如/backup/mysql_data_backup,代码如下: mkdir /backup/mysql_data_backup -p cd /backup...[详细]
-
php图片保存入mysql数据库失败解决办法
[PHP教程] 2022-02-17 13:04:00 185人阅读
图片保存数据库并不是一个明智的做法,我们多半是把图片保存到服务器,然后把图片地址保存到数据库,这样我们每次只要读出图片地址就可以显示了,但下面我还是来介绍一个图片保存到mysql数据库的问题解决办法,代码如下: ...[详细]
-
php下pdo的mysql事务处理应用实例
[PHP教程] 2022-02-17 13:03:41 114人阅读
php+mysql事务处理的几个步骤: 1.关闭自动提交 2.开启事务处理 3.有异常就自动抛出异常提示再回滚 4.开启自动提交 注意:mysql只有这个InnoDB驱动是支持事务处理的,默认MyIsAM驱动不支持,下面是实例代码: ?php try{ $...[详细]
-
php连接远程mysql数据库实例
[PHP教程] 2022-02-17 13:03:18 169人阅读
在php中如果我们要连接远程数据库连接方法也很简单,我们只要把本地连接localhost或127.0.0.1改成指定远程服务器一IP地址即可. 语法:mysql_connect(servername,username,password); 例子:在下面的例子中,我们在一个变...[详细]
-
php mysql备份恢复分卷处理
[PHP教程] 2022-02-17 13:02:25 178人阅读
分卷处理就是把握们要处理的数据分成一个个小文件进行处理了,下面我来给大家介绍一个php mysql备份恢复分卷处理类,实现mysql数据库分卷备份,选择表进行备份,实现单个sql文件及分卷sql导入. 分卷导入类及思路详解 数...[详细]
-
PHP中实现mysql连接与查询实例详解
[PHP教程] 2022-02-17 13:01:53 167人阅读
在网上看了很多教程都是只讲到了一部份,如果连接数据库就只写了连接数据或查询只有查询,下面这文章从php 配置mysql连接然后到查询数据实例. 下面讲一下PHP链接MYSQL数据库,PHP与mysql链接和查询全过程 1、配置:php.i...[详细]
-
PHP将mysql数据库导出为excel表
[PHP教程] 2022-02-17 13:01:29 111人阅读
利用php导出mysql数据库为excel表格的方法很多,最简单的就直接使用php fputcsv函数了,还有就是直接输入csv格式也是可以了,要生成excel标准格式我们需使用第三方插件了. 方法一,利用fputcsv,代码如下: // 输出Excel文...[详细]
- 这篇文章主要介绍了Laravel 5.0 发布 新版本特性详解,...[详细]
- 计算两个日期之间的时间差需要先把两个日期转换成纪元...[详细]
- 初步使用面向对象程序设计,要掌握的就是使用面向对象...[详细]
- 每个 PHP 数组内部都有一个指针,该指针指向数组的某...[详细]
- 因为 PHP 是一个 Web 编程语言,在编程过程中难免会遇...[详细]
- PHP 中提供了 return 语句来返回函数的运行结果,其语...[详细]
- final 关键字的作用如下: 使用 final 修饰的类,不能...[详细]
- 在使用 switch 语句时应该注意以下几点: 和 if 语句...[详细]
- 这篇文章主要给大家介绍了关于PHP替换Word中变量并导...[详细]
- 这篇文章主要介绍了PHP常量DIRECTORY_SEPARATOR原理及...[详细]