vineethvp
asked on
How to Connect SQL Server 2005 Express using PHP
Recently i was trying to connect to a SQL Server 2005 Express database using PHP on a XP machine and i got the following error :
mssql_connect() [function.mssql-connect]: Unable to connect to server&
Please help me on this very urgent.....
mssql_connect() [function.mssql-connect]: Unable to connect to server&
Please help me on this very urgent.....
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Please use the connection string as below
Data Source=.\SQLExpress;Integr ated Security=true; AttachDbFilename=|DataDire ctory|\myd b.mdf;User Instance=true;
if it is different please provide urs to troubleshoot the issue more...
thanks
Kalpan
Data Source=.\SQLExpress;Integr
if it is different please provide urs to troubleshoot the issue more...
thanks
Kalpan
@vineethvp
WE can connect to MSSQL database by using PHP. To connect to MsSQL we have to enable the MsSQL extension support inside php.ini file. For this we have to uncomment the line saying
extension=php_mssql.dll
The status of the MSSQL support can be checked by using phpinfo function.
Once the support is available we can use different functions to handle data from MSSQL database. Now let us try for connecting to MSSQL database server.
Here are the connection steps. Note that we have used one remote db server but same string will work for a local server also.
$dbusername='username';
$dbpassword='password';
$servername='servername';
$link = mssql_connect ($servername,$dbusername,$ dbpassword );
WE can connect to MSSQL database by using PHP. To connect to MsSQL we have to enable the MsSQL extension support inside php.ini file. For this we have to uncomment the line saying
extension=php_mssql.dll
The status of the MSSQL support can be checked by using phpinfo function.
Once the support is available we can use different functions to handle data from MSSQL database. Now let us try for connecting to MSSQL database server.
Here are the connection steps. Note that we have used one remote db server but same string will work for a local server also.
$dbusername='username';
$dbpassword='password';
$servername='servername';
$link = mssql_connect ($servername,$dbusername,$
ASKER