KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I tried out Zend Framework 2 skeleton application and its working fine in Zend Server 5.6 (PHP Version 5.4.0 apache 2.2.21 MYSQL 5.0.10). But i want Zend Framework 2 to connect with MS SQL 2008. I tried the following but it doesn't work and throws exception " An invalid parameter was passed to sqlsrv_execute. " 'db' => array( 'driver' => 'sqlsrv', 'hostname' => 'testserver\test', 'Database' => 'payroll', 'UID' => 'sa', 'PWD' => '123456' ), whats wrong with above db array? please suggest me with correct connection string FYI : i have tested php 5.4 and MS SQL 2008 connection and it works fine, the following connection was established successfully. /* $serverName = "testserver\test"; //serverName\instanceName $connectionInfo = array( "Database"=>"payroll", "UID"=>"sa", "PWD"=>"123456"); $conn = sqlsrv_connect( $serverName, $connectionInfo); if( $conn ) { echo "---------- Connection established --------------------.<br />"; $sql = "select * from users"; $stmt = sqlsrv_query($conn, $sql); while( $row = sqlsrv_fetch_array( $stmt, SQLSRV_FETCH_ASSOC) ) { echo $row['id'].", ".$row['username']."<br />"; } } else{ echo "Connection could not be established.<br />"; die( print_r( sqlsrv_errors(), true)); } */
Tags (comma-separated)
Save Edits
Cancel