Quantcast
Channel: Microsoft Drivers for PHP for SQL Server forum
Viewing all 163 articles
Browse latest View live

Stop words (Noise words)

$
0
0

I am trying to do a query but I get the next error:

[Microsoft][SQL Server Native Client 11.0][SQL Server]Información: la 
condición de búsqueda de texto completo contenía palabras irrelevantes.

Which means something like:

The full-text search had stop words

When I execute the select on the sql server management studio, I don't get that error, only when I execute it from the driver for php.

It is a really easy query:

$query = "select * from table where contains (*,'?')";
$params = array('java and php');

I use sql server 2008 R2



PHP for SQL Server Driver on separate machine as SQL Server

$
0
0

Hello,

Is it possible to install the MS Drivers for PHP for SQL Server on a different machine from SQL Server?  I am installing Drupal and have to use SQL Server Enterprise.  Well the Enterprise is not on the same machine as Drupal. 

I ask this because in the help section of the driver, it seems to say that both need to be on the same machine.  I don't have that setup available to me.

So is it possible to have them separate?

Connecting to SQL Server 2000 with PDO drivers

$
0
0
I read that the PHP PDO drivers use the SQL Server 2012 Native Client ODBC Driver to connect to SQL Server. The SQL Server 2012 Native Client says it supports connecting to SQL Server 2000, but the PHP PDO drivers say that it's for 2005 and higher. Does that mean I can use the PHP PDO 3.0 drivers to connect to SQL Server 2000 afterall?


stored procedure from SQL Server in PHP

$
0
0

I need help running a stored procedure from SQL Server in PHP. PHP is running on a Unix/Linux server. We cannot get OUTPUT variables to return in PHP. The following is the PHP code:

$conn = mssql_connect('server','user','pass');
    mssql_select_db('db', $conn);

    $procedure = mssql_init('usp_StoredProc', $conn);

    $tmpVar1 ='value';
    $tmpVar2 ='value2';

    $outVar1 ='';
    $outVar2 ='';

    mssql_bind($procedure,"@var1", $tmpVar1, SQLVARCHAR,false,false);
    mssql_bind($procedure,"@var2", $tmpVar2, SQLVARCHAR,false,false);

    mssql_bind($procedure,"@outVar1", $outVar1, SQLVARCHAR,true);
    mssql_bind($procedure,"@outVar2", $outVar2, SQLVARCHAR,true);

    mssql_execute($procedure,$conn);print($outVar1);print($outVar2);

The stored procedure looks like so :

    SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO

ALTER proc [dbo].[usp_StoredProc](@var1as varchar(36),@var2as varchar(10),@outVar1 varchar(36) OUTPUT,@outVar2 varchar(36) OUTPUT )asselect distinct @outVar1= row1,@outVar2= row2from table1where column1 =@var1and column2 =@var2

Can anyone tell me why $outVar1 and $outVar2 are not being populated? Thanks a lot for any help!


Can't figure out how to install sql server for PHP

$
0
0

I am trying to install SQL Server for PHP on a server with Server 2008 32 bit.  The exe from http://www.microsoft.com/en-us/download/details.aspx?id=20098 keeps tell me that it is an invalid win32 application.  I've tried running as administrator as well.  Somewhere I read you need to open the exe with 7zip.  I was able to do that and see all the files in there, but where do I go from there?

Thanks

Mike


edit: forgot to mention I'm using Apache for my server

Unable to Generate SSPI Context sql 2008 R2

$
0
0

HI,

We have SQL 2008 R2 on cluster with instances configured on it. When we are trying to make a connection with ODBC (System DSN) to one of the instance , it gives an error "Cannot Generate SSPI context.

We checked below settings.

1. DNS entry is correct , able to do nslookup to db.

2. Refered the url http://support.microsoft.com/kb/811889 perform all activity as described but no resolution.

3. Checked date and time on both the server.

Please let me know what else need to be checked. From the same machine we are able to connect to other instance.

Installing MS SQL PHP drivers under Windows 2008 Server

$
0
0

Hi All,

We are trying to setup MS SQL Server access from PHP 5.4 under Apache 2.2. The host is a Windows Server 2008 SP2 Enterprise. We downloaded the drivers from http://www.microsoft.com/en-us/download/details.aspx?id=20098 (file SQLSRV30.EXE).

When we run the installer, no matter what target folder we select, we get this error message:

"That folder is invalid. Please make sure the folder exists and is writable"

Can anybody provide any hint on this? Or at least point us to a compressed file to extract the right files from. Thank you very much in advance.

Edo.

Problem in creating odbc driver data source

$
0
0

Hi, I have problem in creating data source ODBC driver in SQL server 2008R2 express edition,after i clicked finished and test connection.this is the error that will produce.

Microsoft SQL Server Native Client Version 10.50.1600

Running connectivity tests...

Attempting connection
[Microsoft][SQL Server Native Client 10.0]Named Pipes Provider: Could not open a connection to SQL Server [2].
[Microsoft][SQL Server Native Client 10.0]Login timeout expired
[Microsoft][SQL Server Native Client 10.0]A network-related or instance-specific error has occurred while establishing a connection to SQL Server. Server is not found or not accessible. Check if instance name is correct and if SQL Server is configured to allow remote connections. For more information see SQL Server Books Online.

TESTS FAILED!

I also checked in the SQL server Configuration Manager but i found this error in SQL server services

The remote procedure cal failed.[0x800706be]

Can you please help me on this.

Thank you in advance.


PHP 5.3.9 not updating mssql drivers IIs Windows 2008 R2 server

$
0
0

I am running PHP 5.3.9 on Windows Server 2008 R2 using IIS.

I have installed the drivers from SQLSRV30.EXE into the PHP\ext directory on the server

I have installed the SQL native client on the server

I have changed php.ini to the following:

[PHP_SQLSRV]

extension=C:\PHP\ext\php_sqlsrv_53.nts.dll

I have restarted the server after making the change.  I get the following error message when calling the function:

Call to undefined function sqlsrv_connect()

When I open PHPinfo, it states "mssql-without'.  What did I miss here?


PHP -> MSSQL very slow when the DB is not on the same machine as the PHP code

$
0
0

In the course of trying to move our website to Azure, we've found a problem with our PHP code talking to MSSQL.

On the current dedicated host (hosting both the PHP and the DB), going to a page typically takes less than 2 seconds. I've also run the queries necessary through SMS and they take less than 1 second.

With the website hosted on Azure (connecting to an Azure SQL database) the same page takes around 40 seconds to load. Further investigation showed that this might be caused by the database not being on the same machine as the PHP - when the original website is pointed at a remote database (either another dedicated machine or the Azure SQL instance) the page load time goes up into the 40 second range.

The current webhosting machine is running PHP 5.4 and Microsoft SQL Server Express Edition.

The Azure website is running on PHP 5.4.

In both cases we're using the 3.0.1 Microsoft SQLSRV drivers 

How can we improve the performance when connecting to a remote SQL DB?

Thanks,

James.

Connection to SQL Server 2008 - Login failed for user

$
0
0

Hi

I have setup a PHP webpage and am trying to connect to an SQL Server 2008 on another machine.

I have installed 'Microsoft Drivers for PHP for SQL Server' on my local machine which also has WAMP installed with PHP version 5.3.5.

I am getting the following error:

array ( [0] => Array ( [0] => 28000 [SQLSTATE] => 28000 [1] => 18456 [code] => 18456 [2] => [Microsoft][SQL Server Native Client 10.0][SQL Server]Login failed for user 'DOMAIN\Ryans'. [message] => [Microsoft][SQL Server Native Client 10.0][SQL Server]Login failed for user 'DOMAIN\Ryans'. ) [1] => Array ( [0] => 28000 [SQLSTATE] => 28000 [1] => 18456 [code] => 18456 [2] => [Microsoft][SQL Server Native Client 10.0][SQL Server]Login failed for user 'DOMAIN\Ryans'. [message] => [Microsoft][SQL Server Native Client 10.0][SQL Server]Login failed for user 'DOMAIN\Ryans'. ) )'

I have setup the user under security - logins on the server.

The code i am using to connect to the server is -

$serverName = "crm\MSSQLSERVER,1433";


$connectionInfo = array("UID" => $uid, "PWD" => $pwd, "Database"=> $servername);
$conn = sqlsrv_connect( $serverName, $connectionInfo);

if( $conn )
{
     echo "Connection established.\n";
}
else
{
     echo "Connection could not be established.\n";
     die( print_r( sqlsrv_errors(), true));
}


Any help would be much appreciated.

Regards Ryan

SQLSTATE[IMSSP]: This extension requires the Microsoft SQL Server 2012 Native Client ODBC Driver to communicate with SQL Server

$
0
0

I am using mysql and PHP5.3.19 on Windows 2008 Server R2 Sp1. I.

PHP 5.3.19 is installed using IIS 6.0. But when I try to connect to a SQL Server database I get this error

Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[IMSSP]: This extension requires the Microsoft SQL Server 2012 Native Client ODBC Driver to communicate with SQL Server. Access the following URL to download the Microsoft SQL Server 2012 Native Client ODBC driver for x86: http://go.microsoft.com/fwlink/?LinkId=163712' in

I have followed the instructions and downloaded the Microsoft SQL Server 2012 Native Client ODBC Driver and installed it on my server but It is not working. I still get the same error.  What can I do here? Is there a way To validate thatMicrosoft SQL Server 2012 Native Client ODBC Driver is installed correctly? What Can I do? I have wasted all my day trying to fix this issue.

Thanks

SQL Server 2008 R2 does not replay

$
0
0

Hi,

I have updated my system from PHP 5.2.6 to 5.4.13 and it works. (I used to use mssql driver and I'm using sqlsrv driver now).

The thing is that sometimes, SQL server 2008 R2 does not answer.

The PHP script keeps running waiting for an answer, and if I am on the SQL Server management studio, it pushes me out.

I do not know what can if be, but I switched the PHP version on the IIS to start working with mssql driver again and it works fine.

Any help? Thanks.

sqlsrv configuration

$
0
0
hi some body learn me how to config php and sqlsrv with iis in windows 7 64 bit 

How can I install SQL SERV 3.0 for PHP 5.4 on Windows XP SP3 ??

$
0
0
I want install SQLSERV3.0.EXE for PHP 5.4 on windows XP SP 3 but it's give an error

"not a valid win32 Application"

Any solutions ?

Thanks before..

*HI*

$
0
0

Hi everyone

I am new to this community and I just started learning BI tools.Can any one plz explain me clearly the difference between ssrs and ssas?After extracting the packages in ssis.Should  I use reporting services or cube to generate a report?If possible could anyone provide me with a sample example?.

Thanking you in advance.

SANY

UTF-8 encoding problem

$
0
0

Hi,

I cannot get UTF-8 to work with PHP and MSSQL. Running a query always return strings with '?' instead of the proper accents (like 'éàê')...

Here is my configuration:

- Windows Server 2008 R2 with IIS 7.5

- PHP 5.4.16 NTS

I've googled and tried the following suggestions, none of them worked:

- Adding 'mssql.charset="UTF-8"' to the ini file.

- Using ini_set('mssql.charset', 'UTF-8') before connecting.

All my fields are of type nvarchars. The PHP file itself is encoded using UTF-8 with signature - Codepage 65001. I've restarted W3SVC after making any of the changes mentioned above. One strange thing is that the mssql.charset does not appear in my php info page. I don't know if this is normal.

Here are the relevant lines of my PHP.ini:

[PHP_SQLSRV]
extension=php_sqlsrv_54_nts.dll
[PHP_PDO_SQLSRV]
extension=php_pdo_sqlsrv_54_nts.dll

[MSSQL]
mssql.charset="UTF-8"

Any help would be greatly appreciated.

Thank you!

SQLSRV bug: PRINT causes query fail

$
0
0

I think I have found a bug in the SQLSRV driver. I have tested this in v1.1 and v2.0.

If the stored procedure contains a PRINT statement before the SELECT statement, the query will fail and the value to be printed will appear in the errors array.

For example:

The stored procedure is defined as:

CREATEPROCEDURE dbo.camtest_sps ASPRINT'hello'SELECT * FROM product WHERENAMElike'Am%'

The PHP code is:

	$connectionInfo = array('UID'=>$TEST_MSSQL_USERNAME,'PWD'=>$TEST_MSSQL_PASSWORD,'Database'=>'test');
	$connectMSSQL = sqlsrv_connect($TEST_MSSQL_DATABASESERVER, $connectionInfo);

	$result = sqlsrv_query($connectMSSQL, 'camtest_sps');if ($result === false)
	{
		$errors = sqlsrv_errors();
		print_r($errors);
	}

The output from the PHP script is:

Array
(
  [0] => Array
    (
      [0] => 01000
      [SQLSTATE] => 01000
      [1] => 0
      [code] => 0
      [2] => [Microsoft][SQL Server Native Client 10.0][SQL Server]hello
      [message] => [Microsoft][SQL Server Native Client 10.0][SQL Server]hello
    )

)

If the PRINT statement in the stored procedure appears after the SELECT statement or is commented out, the query is successful.

I hope that a SQLSRV developer can examine this and confirm whether this is a bug or give direction if there is something I can do so that a SP with PRINT statements does not fail.

SQL Server 2008 stops eventually

$
0
0

IIS 7.5 (Windows Server 2008 R2)

PHP 5.4.14

Sqlsrv drivers 3.0.1

SQL Server 2008 R2

The database eventually stops working totally, and the only thing I can do is restart SQL Server. The first time it gave this error, after 3 hours working:

Error: 17886<c/> gravedad: 20<c/> estado: 1.,

The server will drop the connection<c/> because the client driver has sent multiple requests while the session is in single-user mode. This error occurs when a client sends a request to reset the connection while there are batches still running in the session<c/> or when the client sends a request while the session is resetting a connection. Please contact the client driver vendor.

We checked our php code on a developement machine and we couldn't find anything wrong (3 people looked for a code error).

After checking the code we tried it again, and eventually the database stopped answering again, but it didn't gave any error.

My connection string is:

$connectionInfo = array( "Database"=>$database, "UID"=>$uid, "pwd"=>$pwd, "ConnectionPooling"=>0);
$conn= sqlsrv_connect( $serverName, $connectionInfo);

Any idea? Thanks


SQL Driver for PHP 5.5 64bit + Windows Server 2012 IIS8

$
0
0

Hi there,

wanted to ask how the chances are for a sqlsrv driver for the new php 5.5 x64? I ask, because development

on the driver seems to be completely stopped, or am I wrong?

Thanks

Viewing all 163 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>