sqlsrv

Laravel migration cannot find driver when using sqlsrv database in windows

十年热恋 提交于 2021-02-19 03:55:09
问题 I am using sqlsrv database connection in my project as I need to connect to Microsoft SQL Database. I have successfully installed the sqlsrv driver because I can connect to the Database to retrieve data. But when I try to do the Laravel Migration, it shows an error: Illuminate\Database\QueryException : could not find driver (SQL: select * from sysobjects where type = 'U' and name = migrations) Below is my .env DB_CONNECTION=sqlsrv DB_HOST=**********.database.windows.net DB_PORT=1433 DB

sqlsrv very slow over network

我的梦境 提交于 2021-02-10 07:51:35
问题 I'm using sqlsrv (php_pdo_sqlsrv_55_ts.dll and php_sqlsrv_55_ts.dll) in PHP (5.5.12) to connect to a MSSQL 2012 Server over a VPN tunnel. But the transfer rate for large result sets is very slow. Testing SSMS on the same PC over the same VPN tunnel for this query: SELECT * FROM [Data].[dbo].[Logins] WHERE date >= '2014-01-27 00:00:00.000' AND date < '2014-01-29 00:00:00.000' returns about 100,000 rows in 4 seconds. Checking the transfer rate on my firewall/VPN shows 2,500 KB/s (on a 100mbit

MS SQL Native Client Login failed for user when connecting via PHP

前提是你 提交于 2021-02-05 10:47:06
问题 I have a Windows 2008 R2 Datacenter server with IIS 7.5, MS SQL 2012 Express, using PHP 5.6 trying to connect to a database I created, testDB, via Windows Authentication, but am failing to do so. Here is my PHP I am using to connect to my SQL Server\Instance: <?php $serverName = "nmc-intranet\intranetsql"; $connectionInfo = array("Database"=>"testDB", "UID"=>"username", "PWD"=>"password"); $conn = sqlsrv_connect( $serverName, $connectionInfo); if ( $conn ) { echo "Connection successful.<br />

Data type differences between PHP sqlsrv driver and PDO driver

我的梦境 提交于 2021-02-02 02:23:53
问题 Here I am using sqlsrv : $conn = sqlsrv_connect("192.168.1.102,1433", array("Database"=>"RF_User", "UID"=>"rfo-gcp", "PWD" => "")); $tsql = "SELECT birthdate FROM tbl_rfaccount WHERE id = ?"; $stmt = sqlsrv_query($conn, $tsql, array("test")); $result = sqlsrv_fetch_array($stmt); var_dump($result); Result: array(2) { [0]=> object(DateTime)#1 (3) { ["date"]=> string(26) "2020-04-19 20:40:00.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(3) "UTC" } ["birthdate"]=> object(DateTime)#1 (3

Data type differences between PHP sqlsrv driver and PDO driver

风格不统一 提交于 2021-02-02 02:22:20
问题 Here I am using sqlsrv : $conn = sqlsrv_connect("192.168.1.102,1433", array("Database"=>"RF_User", "UID"=>"rfo-gcp", "PWD" => "")); $tsql = "SELECT birthdate FROM tbl_rfaccount WHERE id = ?"; $stmt = sqlsrv_query($conn, $tsql, array("test")); $result = sqlsrv_fetch_array($stmt); var_dump($result); Result: array(2) { [0]=> object(DateTime)#1 (3) { ["date"]=> string(26) "2020-04-19 20:40:00.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(3) "UTC" } ["birthdate"]=> object(DateTime)#1 (3

Data type differences between PHP sqlsrv driver and PDO driver

牧云@^-^@ 提交于 2021-02-02 02:18:23
问题 Here I am using sqlsrv : $conn = sqlsrv_connect("192.168.1.102,1433", array("Database"=>"RF_User", "UID"=>"rfo-gcp", "PWD" => "")); $tsql = "SELECT birthdate FROM tbl_rfaccount WHERE id = ?"; $stmt = sqlsrv_query($conn, $tsql, array("test")); $result = sqlsrv_fetch_array($stmt); var_dump($result); Result: array(2) { [0]=> object(DateTime)#1 (3) { ["date"]=> string(26) "2020-04-19 20:40:00.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(3) "UTC" } ["birthdate"]=> object(DateTime)#1 (3

PHP Sqlsrv connection not working when specify port, instance

半城伤御伤魂 提交于 2021-01-29 13:56:49
问题 PHP version:7.4, SQL Server version:2019, I was going to try to specify port in connection but it didn't work. <?php $serverName = "MYPCNAME, 1433"; $connectionInfo = array( "Database"=>"MyDB", "UID"=>"sa", "PWD"=>'MyPassword'); $conn = sqlsrv_connect( $serverName, $connectionInfo); if( $conn ) { echo "Connection established."; }else{ echo "Connection could not be established.<br />"; die( print_r( sqlsrv_errors(), true)); } ?> Above showed below message. [Microsoft][ODBC Driver 17 for SQL

How to use sqlsrv_prepare function

北慕城南 提交于 2021-01-29 09:10:45
问题 i am making a website with a search function with a database that runs SQL server. Thus, I decided to use sqlsrv functions to use the database. As I want to sanitize my php code against SQL Injection attacks, i decided to use the sqlsrv_prepare function, as suggested by a fellow stackoverflower.My problem is that I can't wrap my head around the function. This is my php code that i made using the example and notes from php.net. <?php $search = $_POST["search"]; $search = "%$search%"; $sql =

Change PHP mssql to sqlsrv (mssql_fetch_row)

烂漫一生 提交于 2021-01-28 18:33:05
问题 I have this code: $query="Select SUBJECT,NOTES from CAMPNOTIFICATION where TYPE LIKE 'message_blackboard' AND VALIDAFTER <= GETDATE() AND (VALIDUNTIL >= GETDATE() OR VALIDUNTIL IS NULL)"; $encode = array(); //$query = strtr($query, array('{$raum}' => $raum)); $query_result = mssql_query($query); while ($row = mssql_fetch_row($query_result)) { $encode[] = $row; $text = $row[1]; $text = str_replace("<br />","\n",$text); $text = str_replace("<br>","\n",$text); $text = str_replace("<br/>","\n",

Pecl install sqlsrv returns No releases available for package

蓝咒 提交于 2021-01-27 19:34:00
问题 While installing sqlsrv module for PHP7 i'm getting following error - No releases available for package "pecl.php.net/sqlsrv Command used sudo pecl install sqlsrv Any idea how to resolve this issue? 回答1: Same problem here... Solved installing modules as root this way (Ubuntu 16.04): wget http://pecl.php.net/get/sqlsrv-4.3.0.tgz pear install sqlsrv-4.3.0.tgz wget http://pecl.php.net/get/pdo_sqlsrv-4.3.0.tgz pear install pdo_sqlsrv-4.3.0.tgz You can check latests available versions here: http:/