-
php 导入excel文件mysql数据库方法
[PHP教程] 2022-02-18 14:49:18 156人阅读
应该说介绍了利用phpexcel插件来实现数据库的导入与导入功能,本文章主要是告诉你把excel导入到mysql数据库的方法. 先下载,下载phpexcel文件,地址:phpexcel.codeplex.com/ 在reader.php文件中找到以下类似代码,第一...[详细]
-
PHP连接MSSQL 时nvarchar字段长度被截断为255
[PHP教程] 2022-02-18 14:48:35 66人阅读
PHP 连接 MSSQL 的新手经常遇到这个问题:数据库里面的 nvarchar 字段中数据一切正常,但是用 PHP 查询出来却发现长度只有 255,我们都知道,在 MySQL 里面 varchar 的长度只有 255,但是 MSSQL 却不是,不会是 PHP 将 nva...[详细]
-
php中使用sql server验证进行连接数据库
[PHP教程] 2022-02-18 14:48:16 145人阅读
当您连接到 SQL Server 时,SQL Server Driver for PHP 支持 SQL Server 身份验证,在使用 SQL Server 身份验证连接到 SQL Server 时必须考虑以下几点. 必须对服务器启用 SQL Server 混合模式身份验证,在尝试建立连接...[详细]
-
php mysql 事务处理实现程序
[PHP教程] 2022-02-18 14:47:59 85人阅读
要实现本功能的条件是环境 mysql 5.2 /php 5 支持事务的table 类型,需要InnoDB,有了这些条件你就可以做上面的实现了,这个事物回滚操作是大项目经常用到的,像银行,电子商务等都会用到,有需要的朋友可以参考一下. 近期...[详细]
-
利用phpexcel读取excel实现代码
[PHP教程] 2022-02-18 14:47:41 53人阅读
phpexcel是一个php的插件,他是用来读取excel文档的,如果没有它的话自己要写个这样的工具比较麻烦,现在有了现成的excel读取插件方便了很多. php对excel文件进行循环读取,php对字符进行ascii编码转化,将字符转为十进制...[详细]
-
php 连接mssql nvarchar和text被截断解决办法
[PHP教程] 2022-02-18 14:47:26 161人阅读
在php连接mssql 时我突然发现nvarchar被截为255了,后面数据丢失了,而text也被截取了,下面我们查了手册做了如下解决办法. nvarchar被截为255解决办法: PHP 将 nvarchar 按照 MySQL 的 varchar 处理了吧,代码如下: sel...[详细]
-
php pdo连接mssql server数据库
[PHP教程] 2022-02-18 14:46:55 133人阅读
本文章简单的利用了php的pdo来连接微软的mssql server数据库,下面来看看实例,实例代码如下: $dsn = mssql:dbname=bookStore_demo;host=192.168.1.106; $user = sa; $password = 123; //mssql_connect(192.168.1.106,...[详细]
-
php导入.sql到数据库的方法
[PHP教程] 2022-02-18 14:40:46 56人阅读
以前我们都是利用phpmyadmin或在dos下进行.sql文件的导入,今天我们来看看在php下同样可以实现把.sql文件导入到mysql数据库中,代码如下: ?php $conn=mysql_connect(localhost,root,password);//指定数据库连接参数fun...[详细]
-
php5.3如何连接sqlserver2000
[PHP教程] 2022-02-17 13:25:10 142人阅读
我们知道新版的php5.3是不支持mysql自带的mssql_connect这个数据连接函数,如果需要连接sqlserver数据库,我们只能使用了com 接口来做. 1.Com链接 ADODB.Connection,代码如下: $conn = new Com(ADODB.Connection); //...[详细]
-
php读取mssql时间显示格式解决方法
[PHP教程] 2022-02-17 13:24:47 71人阅读
我们知道mssql不像php那样可以使用time,他生成的是时间格式DateTime这样就显示不对了,代码如下: while( $row = sqlsrv_fetch_array( $result, SQLSRV_FETCH_ASSOC)) { print_r($row[datetime]);//这个字段是mssql的...[详细]
- 这篇文章主要介绍了Laravel 5.0 发布 新版本特性详解,...[详细]
- 计算两个日期之间的时间差需要先把两个日期转换成纪元...[详细]
- 初步使用面向对象程序设计,要掌握的就是使用面向对象...[详细]
- 每个 PHP 数组内部都有一个指针,该指针指向数组的某...[详细]
- 因为 PHP 是一个 Web 编程语言,在编程过程中难免会遇...[详细]
- PHP 中提供了 return 语句来返回函数的运行结果,其语...[详细]
- final 关键字的作用如下: 使用 final 修饰的类,不能...[详细]
- 在使用 switch 语句时应该注意以下几点: 和 if 语句...[详细]
- 这篇文章主要给大家介绍了关于PHP替换Word中变量并导...[详细]
- 这篇文章主要介绍了PHP常量DIRECTORY_SEPARATOR原理及...[详细]