I doubt msSQL differs from MySQL -- $link = mssql_connect( $host, $user, $pass ) or die( "Can't connect to the DB!" ); mssql_select_db( $dbname, $link ) or die( "Can't select database" );
$query = "SELECT * FROM members WHERE user='$user' AND pass='$pass';"; $result = mssql_query( $query, $link ); if(!mssql_num_rows( $result )){ die( "Username/Password no good" ); } else{ die( "Everything is okay!" ); } like i said, i think all the mysql functions in php have a mssql equiv. -- like mssql_num_rows(). -Joe "Chris" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Hi. I have a table that contains lots of names in mssql. and i want to make > a page > where each of theese individuals can login with that spesific username and > password. > So my question is : what is the proper (best) command to use for sending and > returning the info? > > <?PHP > $link = mssql_connect($hostname,$username,$password); > $dblink = mssql_select_db($dbname, $link); > if ( $link && $dblink ) > { > $query = "select * from members where user = '$user' and pass = '$pass'"; > $result = mssql_query( $query ); > if ( $result ) echo "correct login"; > else echo "wrong login"; > } > ?> > > This is not working... i have tried everything i can think of that can work > but with no luck. > So if someone have a solution for me... i would apriciate it :) > > (and yes i do have defined all the vars in the script they are just not that > important here....) > > -Chris > > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php