Mga master? unsay mga paagi para ma connect nako ang duha? nag dagan na ang akong mssql Through SQL Express 2005.. any suggestions?
![]()
Mga master? unsay mga paagi para ma connect nako ang duha? nag dagan na ang akong mssql Through SQL Express 2005.. any suggestions?
![]()
Sure ko mag ask mo nganu MSSQL ako gi pares sa PHP...
ani na xa.. Gipaconvert mi ug website from COLDFUSION + MsSQL to PHP + MsSQL
im not new to MsSQL pero .NET man to akong gamit oy.. hahaha
mssql_connect sab kay dili maka connect..
try daw use ug PDO bro...basin sayop imong connection string...
You can use the mySqli or PDO but I would suggest using PDO because it offers exceptions where you can put it in try catch. PHP Data Objects is included with PHP 5.1, provides OOP interface. It also provides a consistent interface that's portable between other database servers such as Oracle, DB2, MS SQL Server, and PostgreSQL. The code looks like this,
Where your $dsn should look like this "sqlsrv:server=hostname_or_ip;Database=database_na me;"Code:try { $db = new PDO($dsn, $username, $password, $options); }catch (PDOExceptions $e) { $error_message = $e->getMessage(); exit; }
As for the "$options = array(PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION);"
Hope this help...
try daw check if na load nimo ang driver?..padagani ug phpinfo daw
Similar Threads |
|