Thinkphp3.1 php 链接SqlServer

ThinkPHP链接

M("lk_employeeInfo","Null/表前缀","sqlsrv://账号:密码@服务器:端口/数据库")->query("select * from lk_employeeinfo where state = 'onJob'");

PHP链接

try{
$db = sqlsrv_connect('服务器',array("UID"=>'账号', "PWD"=>'密码', "Database"=>"数据库"));
}catch(PDOException $e){
echo "ERROR:".$e->getMessage();
}
$a = sqlsrv_query($db,"select * from lk_employeeinfo where state = 'onJob'");
while( $row = sqlsrv_fetch_array( $a, SQLSRV_FETCH_ASSOC) ) {
echo $rew['roleid'];
}
上一篇:机器学习进阶-光流估计 1.cv2.goodFeaturesToTrack(找出光流估计所需要的角点) 2.cv2.calcOpticalFlowPyrLK(获得光流检测后的角点位置) 3.cv2.add(进行像素点的加和)


下一篇:IOS开发—IOS 8 中设置applicationIconBadgeNumber和消息推送