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
6
votes
3 answers

[Microsoft][SQL Server Native Client 11.0][SQL Server]Invalid object name

I want to access the MS SQL Server and have the select query. I have installed the dll files and am using the sqlsrv_query. The connection has been successful but I get: [Microsoft][SQL Server Native Client 11.0][SQL Server]Invalid object name as…
learner1988
  • 141
  • 3
  • 11
6
votes
6 answers

sqlsrv array doesn't return all rows

I can't seem to figure out why sqlsrv_fetch_assoc only returns 1 row when there are 2 rows in the result set according to sqlsrv_num_rows. I've tried to hard code the parameter, but I still get the same result. SSMS Result Set id …
Kermit
  • 33,827
  • 13
  • 85
  • 121
5
votes
2 answers

Laravel binding parameter using insert() with convert() inside

I am having a hard time binding my SQL query and I only have a few braincells left. Basically, this code works but prone to SQL injection: return DB::connection('sqlsrv_rfo_user') ->table('dbo.tbl_rfaccount') ->insert([ 'Email' =>…
Ronnel Martinez
  • 135
  • 4
  • 15
5
votes
0 answers

Add SQLSRV extension on multiple PHP versions on Ubuntu/NGINX

I had a server set up with the following installed and running: Ubuntu 20.04 NGINX 1.17.10 PHP 7.4.5 The PHP installation does have the PDO SQLSRV driver installed and working properly. I needed to add PHP 5.6 to the same server for an older web…
user3521590
  • 111
  • 3
  • 6
5
votes
2 answers

PHP PDO Sqlsrv always return every values as string

How do I get value from DB with correct field type? I'm using PDO Sqlsrv to fetch data from DB and I always receive data as string like: customer_id : "1" My customer_id field type is integer it should be customer_id : 1 But phone_number field type…
Vintage Beef
  • 475
  • 6
  • 18
5
votes
1 answer

PHP SQLSRV has intermitent delay on sqlsrv_fetch_array/sqlsrv_fetch

we switched our DB connection from ADODB to SQLSRV and I seem to have issues with it causing intermitent delays using sqlsrv_fetch_array. I do a query in my database that returns around 426 rows with 5 fields. The code looks like this (for speed…
user3242224
  • 169
  • 7
5
votes
1 answer

How to connect to MSSQL 2000 from PHP 5.3 and up

I have a legacy business application built on MS SQL Server 2000. I have some webbased utilities that access this database using PHP 5.2 with mssql extension. I need to reinstall the web server, and I looked forward to upgrade to PHP 5.4.…
Lorenz Meyer
  • 19,166
  • 22
  • 75
  • 121
5
votes
2 answers

SQLSRV and multiple selects in Stored Procedure

I have a Stored Procedured which creates a temporary table (#test), fills it with data from another table, runs 3 selects on this temporal table and drops it. The original table it's over 20 GBs big and the 3 SELECT statements contain a lot of…
user2844368
  • 55
  • 1
  • 3
4
votes
4 answers

Laravel migration cannot find driver when using sqlsrv database in windows

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,…
Lim Socheat
  • 705
  • 2
  • 12
  • 25
4
votes
1 answer

Php calling sqlserver backup database script, backup file created and then deleted

I have a php calling sqlserver backup script. The script, if executed directly from SSMS, it created the backups successfully. But, when called via php, I can see the file created on the destination folder, but it seems that when php finishes, the…
rherry
  • 95
  • 4
4
votes
1 answer

Laravel Microsoft Sql Server connection error

I get the following error and I don't know why: Illuminate \ Database \ QueryException (08001) SQLSTATE[08001]: [Microsoft][ODBC Driver 13 for SQL Server]TCP Provider: No connection could be made because the target machine actively refused…
tks.tman
  • 414
  • 6
  • 16
4
votes
0 answers

How to install sqlsrv for xampp mac os version

I used XAMPP 7.1.11 for Mac OS. I could not find the extensions directory to install SQLSRV extension I try so many way to solved this problem about 2 Weeks. Is there anyone every setup PHP like this. Let discus together.
4
votes
3 answers

Mssql_connect php7.1 with ubuntu

I'm using Windows 10 and SQL Server for my website (I'm using codeigniter), in Windows here is my setting $db['default'] = array( 'dsn' => '', 'hostname' => '----', 'username' => '--', 'password' => '-----', 'database' =>…
YVS1102
  • 2,658
  • 5
  • 34
  • 63
4
votes
3 answers

PDO::quote() for SQL Server mis-quotes strings containing ASCII NUL

I'm trying to insert ASCII NUL characters (\0 aka U+0000) into an SQL Server database from PHP, using pdo_sqlsrv. This is a requirement for handling PHP serialized strings, which contain NUL characters to represent private/protected…
HappyDog
  • 1,230
  • 1
  • 18
  • 45
4
votes
5 answers

Pecl install sqlsrv returns No releases available for package

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?
Praveen Govind
  • 2,619
  • 2
  • 32
  • 45
1
2
3
66 67