PHP & MSSQL Express issues (Newbie)

PHP & MSSQL Express issues (Newbie)

am 25.02.2007 13:05:27 von cheycomm

Hi All,

I am trying to collect info from a MSSQL DB and I am not even able to
get passed the connection. I don't get any errors I just get a blank
page when I go to the site.

PHP is working, see attached phpinfo(). Any help is appreciated.

Windows XP SP2, IIS 5.1, PHP 5.2.1, MSSQL Server Express Edition




"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">




$con=mssql_connect("serverName\sqlexpress","username","passw ord");

if ($con)
$conStatus="It connnected";
else
$conStatus "didn't work";

mssql_close($con);
?>

Test PHP MSSQL









Re: PHP & MSSQL Express issues (Newbie)

am 25.02.2007 13:18:48 von Shion

Todd Michels wrote:
> Hi All,
>
> I am trying to collect info from a MSSQL DB and I am not even able to
> get passed the connection. I don't get any errors I just get a blank
> page when I go to the site.
>
> PHP is working, see attached phpinfo(). Any help is appreciated.
>
> Windows XP SP2, IIS 5.1, PHP 5.2.1, MSSQL Server Express Edition
>
>
>
>
> > "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
>
>
>
>
> > $con=mssql_connect("serverName\sqlexpress","username","passw ord");
>
> if ($con)
> $conStatus="It connnected";
> else
> $conStatus "didn't work";
>
> mssql_close($con);
> ?>
>
> Test PHP MSSQL
>
>
>
>
>
>
>
>
>
>

I suggest you look a little bit at the user comments at
http://www.php.net/manual/en/function.mssql-connect.php
it seems like there are differences depending on the version of mssql.

You could try to use
$con=mssql_connect("localhost,1433","username","password");


--

//Aho

Re: PHP & MSSQL Express issues (Newbie)

am 25.02.2007 17:41:04 von ron

On Sun, 25 Feb 2007 13:18:48 +0100, "J.O. Aho"
wrote:

>Todd Michels wrote:
>> Hi All,
>>
>> I am trying to collect info from a MSSQL DB and I am not even able to
>> get passed the connection. I don't get any errors I just get a blank
>> page when I go to the site.
>>
>> PHP is working, see attached phpinfo(). Any help is appreciated.
>>
>> Windows XP SP2, IIS 5.1, PHP 5.2.1, MSSQL Server Express Edition
>>
>>
>>
>>
>> >> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
>>
>>
>>
>>
>> >> $con=mssql_connect("serverName\sqlexpress","username","passw ord");
>>
>> if ($con)
>> $conStatus="It connnected";
>> else
>> $conStatus "didn't work";
>>
>> mssql_close($con);
>> ?>
>>
>> Test PHP MSSQL
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>
>I suggest you look a little bit at the user comments at
>http://www.php.net/manual/en/function.mssql-connect.php
>it seems like there are differences depending on the version of mssql.
>
>You could try to use
>$con=mssql_connect("localhost,1433","username","password");

Mine is localhost for what it's worth. I struggled with this too :)

Re: PHP & MSSQL Express issues (Newbie)

am 25.02.2007 17:55:17 von Shion

Ron wrote:
> On Sun, 25 Feb 2007 13:18:48 +0100, "J.O. Aho"
> wrote:

>> I suggest you look a little bit at the user comments at
>> http://www.php.net/manual/en/function.mssql-connect.php
>> it seems like there are differences depending on the version of mssql.
>>
>> You could try to use
>> $con=mssql_connect("localhost,1433","username","password");
>
> Mine is localhost for what it's worth. I struggled with this too :)


What error message do you guys get when you try to connect, try to output the
mssql_get_last_message() (mssql don't have at all as much error reporting
support as mysql).


--

//Aho