Connecting Problem with sql Server

Looking to hire a PHP developer for a paid position? Looking for a paid PHP job? Want to post your resume? Let the job hunt begin...

Moderator: General Moderators

Post Reply
me_not_4_php
Forum Newbie
Posts: 2
Joined: Tue Nov 03, 2009 11:36 pm

Connecting Problem with sql Server

Post 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
User avatar
novice4eva
Forum Contributor
Posts: 327
Joined: Thu Mar 29, 2007 3:48 am
Location: Nepal

Re: Connecting Problem with sql Server

Post 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.
Post Reply