Questions tagged [sqlsrv]

The SQLSRV is a PHP extension which allows you to access Microsoft SQL Server and SQL Azure databases when running PHP on Windows or Linux.

References

999 questions
4
votes
3 answers

Call to undefined function sqlsrv_connect() - Troubleshooting

System Information CMS: Wordpress Web Server: XAMPP PHP Version: 5.5.30 MS Management Studio 17 Goal Establish MSSQL Database connection using PHP What has been done Downloaded SQLSRV Drivers Copied files php_pdo_sqlsrv_55_nts.dll and…
Ben Löffel
  • 931
  • 4
  • 12
  • 29
4
votes
0 answers

sqlsrv_query returns false without any error (sqlsrv_errors())

We have to execute an MSSQL stored procedure in order to insert a set of rows and return the result. The procedure is working perfectly as intended when executed inside the Microsoft SQL Server Management Studio. But it's not working when executed…
user2982042
  • 100
  • 7
4
votes
1 answer

PDOException: SQLSTATE 01002 Adaptive Server connection failed (severity 9)

I have been following some answers over stackoverflow. My odbc. ini (located in /etc/odbc.ini) [MSSQL] Description = MS SQL Server Driver = /usr/local/lib/libtdsodbc.so Server = host.of.the.server UID = myusername PWD = mypassword ReadOnly = No Port…
4
votes
1 answer

PHP How to handle errors if multiple sqlsrv-querys are sent simultaneously

I've got the following Table: CREATE TABLE [dbo].[TestDB] ( [col1] INT NOT NULL, [col2] VARCHAR(50) NOT NULL ); Now I want to add entrys: $params=array(123,'someString'); $sql = "insert into testDB values(?,?)"; $stmt =…
Simon Balling
  • 481
  • 1
  • 5
  • 14
4
votes
1 answer

PDO sqlsrv database connection timeout

With MySQL I can use $pdo->setAttribute(PDO::ATTR_TIMEOUT, 5); to set connection timeout value. But when I'm using sqlsrv driver, it's working different. Can you explain how to set connection timeout with sqlsrv? Thanks in advance.
lingo
  • 1,848
  • 6
  • 28
  • 56
4
votes
2 answers

Search parameters SQLSRV_QUERY for WHERE IN syntax

I wonder if there is a way to pass some values into the parameters option on the sqlsrv_query function. I tried a few things but could not get it to work. This query is what I want to be executed: SELECT id, name, etc FROM sqlTable WHERE id IN ('1',…
Fin
  • 386
  • 1
  • 15
4
votes
2 answers

Call to undefined function sqlsrv_connect() in xampp

When I tried to connect sqlsrv server in codeigniter, I got this error message. Call to undefined function sqlsrv_connect() in xampp Below is codes from database.php $db['default'] = array( 'dsn' => '', 'hostname' =>…
J Wayne
  • 51
  • 1
  • 1
  • 4
4
votes
3 answers

Updating MSSQL table with PHP + sqlsrv

I'm trying to do the simplest thing... I have a form with 2 fields. I want to enter data in those fields and have them write that data to my db (mssql using sqlsrv driver). Connecting to the db isn't a problem. Here's my form processor (only set up…
danzo
  • 301
  • 1
  • 5
  • 18
4
votes
2 answers

Select Schema and table in sqlserver with Yii2?

i have sql server database which have multiple schema. i tried to select from one of table from different schema using sqlsrv driver but is says invalid configuration, The table does not exist. how can i select the schema in table using sqlsrv…
Gamma
  • 331
  • 1
  • 3
  • 15
4
votes
3 answers

Connecting to SQL Server via CodeIgniter

I'm trying to setup a Windows dev environment: Windows 8.1 with IIS 8.5 running SQL Server 2008RC2 and PHP 5.3.24 CodeIgniter 2.1.4 I can connect to the database just fine via PDO in a normal PHP script. But when I try to connect via CodeIgniter I…
user1430046
4
votes
1 answer

PHP w/ MS SQL slow on bulk insert

I am having an issue with bulk inserting into a staging table in MSSQLSRV 2008 R2. I am inserting a CSV with ~200,000 lines and it is taking roughly 5 minutes to complete. I tried using both PDO and the sqlsrv driver. They both seem to yield poor…
Gimli
  • 498
  • 1
  • 3
  • 14
4
votes
2 answers

Microsoft sqlsrv extension for php 5.5.x

We are running php 5.3.27 on Windows, nts. We just failed a PCI scan due to a session fixation vulnerability in PHP and need to regain PCI compliance. It is a little frustrating, as we use session_regenerate_id() after login, so in my eyes…
Gavin
  • 2,153
  • 2
  • 25
  • 35
4
votes
1 answer

'Not a valid ss_sqlsrv_stmt resource' error when trying us a php function to return sqlsrv_query result

I have recently switched a PHP app from mssql to sqlsrv and would like to continue using a couple custom functions to handle all my SQL requests. I get an error Warning: sqlsrv_fetch_array(): 2 is not a valid ss_sqlsrv_stmt resource in... when…
TravDog95
  • 41
  • 1
  • 1
  • 3
4
votes
5 answers

sqlsrv drivers slow in codeigniter?

I have installed the latest version of CI 2.1.3 Now after running a query, I am getting a very slow response time for something very simple such as: function Bash(){ $sql = “SELECT * FROM Contacts”; $stmt = sqlsrv_query( $conn, $sql ); if(…
James Bond
  • 699
  • 1
  • 10
  • 17
3
votes
4 answers

Symfony + mssql. Error tls_process_server_certificate:certificate verify failed:self signed certificate

I try to connect mssql to my symfony project, but get error SQLSTATE[08001]: [Microsoft][ODBC Driver 18 for SQL Server]SSL Provider: [error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed:self signed certificate]" So I…
Nastanja
  • 49
  • 1
  • 2
1 2
3
66 67