Page 1 of 1

Connecting Problem with sql Server

Posted: Tue Nov 03, 2009 11:42 pm
by me_not_4_php
hello...

i m working in php and trying to connect with SQL Server database.but its creating problem


my syntax is ....

$con1 = mssql_connect("dbase","sa","");
mssql_select_db("exams",$con1)or die("Couldn't connect to SQL Server on myServer");


dbase: is my host name..
exams: is my dbname



what else should i do with that....please reply me as sooon as possible i will be very thankful.

regards,,


honey

Re: Connecting Problem with sql Server

Posted: Thu Nov 05, 2009 4:07 am
by novice4eva
first start with enabling error reporting, this is done with these two little but very helpful codes

Code: Select all

 
//PLACE THEM ON TOP OF UR CODE
ini_set('display_errors', 1);
ini_set('error_reporting', E_ALL);
 
You should get some error/warnings printed that will give you hints of what could have gone wrong.