A noob who can't even connect to mssql~ plz help

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
night5life
Forum Newbie
Posts: 2
Joined: Sat Aug 08, 2009 6:09 am

A noob who can't even connect to mssql~ plz help

Post by night5life »

Hello everyone,

First off let me say I just recently (like a day ago) got into php and mssql 2005/2008.

Okay so these are the things i have setup:

- Apache with Xampp (on php.ini, there is no semicolon on both php_mysql.dll and php_mssql.dll)
- php_mssql.dll is in ext folder and system32
- I have mssql 2008 express running atm with TCP/IP enabled on port 1433
- I have a database on mssql 2008 that i customized (the one i would like to access)

SO, basically... i can't even connect to the dang mssql... lol
I used this:

<?php
$server = 'ADMIN-PC\SQLEXPRESS'; <-- I also tried 'localhost, 1433'
$link = mssql_connect($server, 'sa', '');
if(!$link)
{
die('Something went wrong while connecting to MSSQL');
}
?>

BUT no luck.... i get the error saying could not connect to 'ADMIN-PC\SQLEXPRESS'

BUT i successfully got into the server using ODBC:
(yes i have odbc setup)
<?php
$dsn="sqlserver";
$username="sa";
$password="";
odbc_connect($dsn,$username,$password);
?>

So i have no idea what to do here and asking this awesome community for help!
Thank you all in advance.
SidewinderX
Forum Contributor
Posts: 407
Joined: Fri Jul 16, 2004 9:04 pm
Location: NY

Re: A noob who can't even connect to mssql~ plz help

Post by SidewinderX »

Is there any reason in particular you are using mssql as opposed to mysql?
night5life
Forum Newbie
Posts: 2
Joined: Sat Aug 08, 2009 6:09 am

Re: A noob who can't even connect to mssql~ plz help

Post by night5life »

yes, the database i'm using has procedures that mysql cannot support (it's a database of a game: knight online).
User avatar
Eran
DevNet Master
Posts: 3549
Joined: Fri Jan 18, 2008 12:36 am
Location: Israel, ME

Re: A noob who can't even connect to mssql~ plz help

Post by Eran »

MySQL has had procedures for several years now (since 5.0)
Post Reply