(php)thinkphp3.2配置sql_server

 

(php)thinkphp3.2配置sql_server

标签: php thinkphp sql_server
 分类:
php(18) 
最近要整一个crm和erp的对接,最坑的是,erp的是用.net写的,数据库是sql_server!!!一开始还以为对接不了了,没想到的是,后来去网上查了一下,竟然可以,被老板知道了0.0哎,那就整吧,一开始还以为这是一个艰巨的任务,但是当我在配置的时候,报错了!就知道可行!!还不算太艰巨,哈哈,请见下面的详解:
1,首先呢,需要根据你的电脑,下载相应的dll文件,php_pdo_sqlsrv_55_ts.dll和php_sqlsrv_55_ts.dll这两个扩展(注意 55 是代表你的php版本是5.5的,ts代表的是你的php目录下的的一个扩展php5ts.dll,如果你的是php5nts.dll的话,那就要下载后面 nts 的扩展了,还有就是扩展一定要和系统的位数相同,要不然没用)。
2.下载完后,把这两个扩展放到php目录下的ext里面,然后,要在php.ini里面加上对应的引用。(extension=扩展名1;extension=扩展名2;),加完之后,还要在配置文件(php.ini)里面找到mssql.secure_connection = Off,把Off改成On.然后重启。
3.在项目的配置文件里面(config.php)的配置:
'DB_TYPE'               =>  ‘’,     // 数据库类型
    'DB_HOST'               =>  '', // 服务器地址
    'DB_NAME'               =>  '',          // 数据库名
    'DB_USER'               =>  '',      // 用户名
    'DB_PWD'                =>  '',          // 密码
    'DB_PORT'               =>  '',        // 端口
    'DB_PREFIX'             =>  '',    // 数据库表前缀
    'DB_PARAMS'             =>  array(), // 数据库连接参数    
    'DB_DEBUG'              =>  TRUE, // 数据库调试模式 开启后可以记录SQL日志
    'DB_FIELDS_CACHE'       =>  true,        // 启用字段缓存
    'DB_CHARSET'            =>  'utf8',      // 数据库编码默认采用utf8
    'DB_DEPLOY_TYPE'        =>  0, // 数据库部署方式:0 集中式(单一服务器),1 分布式(主从服务器)
    'DB_RW_SEPARATE'        =>  false,       // 数据库读写是否分离 主从式有效
    'DB_MASTER_NUM'         =>  1, // 读写分离后 主服务器数量
    'DB_SLAVE_NO'           =>  '', // 指定从服务器序号
4.在程序里面就可以直接用了:
$data = M('ceshi')->select();
        // $data = $Model->where(['id'=>1])
        dump($data);exit;
这样就搞定啦,去页面运行一下把。

 

转载于:https://www.cnblogs.com/jamescr7/p/8628708.html

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/280871.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

viewData

viewdata[alert]"alert(你好)"<script>viewdata[alert]</script> 在Controller存储数据 在 界面得到 关于 ViewData和ViewMode 点击这里 http://wanshiqian1221.blog.163.com/blog/static/6872130420095242016546/

Blog.Core 第四季度开源更新说明书

B/C/V/PAn open-source organization based on .NET/Core and Vue (React/NG) to quickly build MVC & SPA and microservice application.开源贡献NETCORE架构设计BCVP开发组成员说&#xff1a;BCVP是以Blog.Core为核心框架设计的一整套前后端分离、RBAC与数据鉴权、统一C…

关于HibernateDaoSupport中的getHibernateTemplate().execute及executeFind方法

转自&#xff1a;https://blog.csdn.net/angus_17/article/details/8501668 1. 这两个方法都是为了Spring在接管Hibernate之后&#xff0c;可以对HibernateDaoSupport进行灵活的扩展而用的。 二者的主要区别在于&#xff0c;execute返回的是一个Object&#xff0c;而executeFin…

bootstrap笔记

1.整体排版 <div class"container"><div class"row"><div class"col-md-offset-3 col-md-6"><div class"panel panel-primary"><div class"panel-heading"><h3 class"panel-title&q…

如何将联系人导入Windows联系人文件夹和从中导出联系人

In Windows 7 and 8, there is a Contacts folder in your user directory. This folder can be useful if you have your contacts in a single .vcf file and want to move them into a .csv file for importing into programs like Outlook 2013. 在Windows 7和8中&#xff…

【vue】跟着老马学习vue-数据双向绑定

学习了node.js教程&#xff0c;只能说是有了一定的了解&#xff0c;之前也了解了webpack和es6的核心内容&#xff0c;也看过vue2.0的官网教程&#xff0c;并结合视频看过项目&#xff0c;但是理解和运用仍然存在很多问题&#xff0c;接下来的一段时间&#xff0c;跟着老马学习v…

位运算符2

class TestExer1{public static void main(String[] args){int m 12;int n 5;System.out.println("m:" m " n:" n);//方法一&#xff1a;提供一个临时变量。//int temp m;// m n;// n temp;//System.out.println("m:" m &…

C# 实例解析事件委托之EventHandler

概述事件属于委托的一个子集&#xff0c;像我们平时界面上的鼠标点击按钮后响应事件、事件的发布和订阅等都需要用到委托.通过委托可以很好的实现类之间的解耦好。事件委托EventHandler的函数原型如下&#xff1a;delegate 表示这个个委托&#xff0c;事件委托没有返回值&#…

C# HttpWebRequest post 数据与上传图片到server

主体 Dictionary<string, object> postData new Dictionary<string, object>(); string fileFullPath this.imgFullPath;if (!File.Exists(fileFullPath)){Message(Error, "file not exist: " fileFullPath);goto EndGetPost;}// 先定义一个…

多亏了Google相册,如何一键释放Android手机上的空间

Let’s be real here: modern smartphones have limited storage. While they’re coming with a lot more than they used to, it’s easy to fill 32GB without even realizing it. And with today’s high-end cameras, well, pictures and videos can quickly consume a bi…

用window.location.href实现页面跳转

在写ASP.Net程序的时候&#xff0c;我们经常遇到跳转页面的问题&#xff0c;我们经常使用Response.Redirect &#xff0c;如果客户要在跳转的时候使用提示&#xff0c;这个就不灵光了&#xff0c;如&#xff1a;Response.Write("<script>alert(恭喜您&#xff0c;注…

(一)使用appium之前为什么要安装nodejs???

很多人在刚接触appium自动化时&#xff0c;可能会像我一样&#xff0c;按照教程搭建好环境后&#xff0c;却不知道使用appium之前为什么要用到node.js&#xff0c;nodejs到底和appium是什么关系&#xff0c;对nodejs也不是很了解&#xff0c;接下来我和大家一起理解一下他们之间…

WPF效果第二百零四篇之自定义更新控件

好久没有更新文章,今天抽空来分享一下最近玩耍的自定义控件;里面包含了自定义控件、依赖属性和路由事件;来看看最终实现的效果:1、先来看看前台Xaml布局和绑定:<Style TargetType"{x:Type Cores:UploadWithProgressControl}"><Setter Property"Templat…

u3d 逐个点运动,路径运动。 U3d one by one, path motion.

u3d 逐个点运动&#xff0c;路径运动。 U3d one by one, path motion. 作者&#xff1a;韩梦飞沙 Author&#xff1a;han_meng_fei_sha 邮箱&#xff1a;313134555qq.com E-mail: 313134555 qq.com 逐个点运动&#xff0c;路径运动。 Im going to do some motion and path. 如果…

小米净水器底部漏水_漏水传感器:您可能没有的最容易被忽视的智能家居设备...

小米净水器底部漏水While most smarthome products are aimed at convenience, there’s one smarthome device that’s actually quite useful, possibly saving you headaches and ton of money: the trusty water leak sensor. 虽然大多数智能家居产品都旨在提供便利&#x…

Unity3D笔记十 游戏元素

一、地形 1.1 树元素 1.2 草元素 二、光源 2.1 点光源 点光源&#xff08;Point Light&#xff09;&#xff1a;好像包围在一个类似球形的物体中&#xff0c;读者可将球形理解为点光源的照射范围&#xff0c;就像家里的灯泡可以照亮整个屋子一样。创建点光源的方式为在Hierarch…

BZOJ3511: 土地划分

【传送门&#xff1a;BZOJ3511】 简要题意&#xff1a; 给出n个点&#xff0c;m条边&#xff0c;每个点有A和B两种形态&#xff0c;一开始1为A&#xff0c;n为B 给出VA[i]和VB[i]&#xff0c;表示第i个点选择A和B形态的价值 每条边给出x,y,EA,EB,EC&#xff0c;表示如果x和y都为…

facebook 文本分类_如何禁用和自定义Facebook的通知,文本和电子邮件

facebook 文本分类Facebook is really keen on keeping you on their platform. One of the ways they do that is by sending you notifications whenever the tiniest thing happens. And you won’t just see them on the site—Facebook will also notify you by email, wi…

django06: ORM示例2--uer 与file

存放路径&#xff1a;https://git.lug.ustc.edu.cn/ 笔记 外键与多键 path models.ForeignKey(to"Path")file models.ManyToManyField(to"File") code 处理方式 new_path request.POST.get("new_path",None)models.File.objects.create(…

Error opening terminal: xterm-256color

在使用gdb调试linux内核时&#xff0c;提示如下错误&#xff1a; arm-none-linux-gnueabi-gdb --tui vmlinux Error opening terminal: xterm-256color. 解决办法&#xff1a; 1、 edit your .bash_profile file vim .bash_profile 2、commnet #export TERMxterm-256colo…