Re: PHP - mssql

From: Date: Wed, 20 Mar 2002 18:59:22 +0000
Subject: Re: PHP - mssql
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-89373@lists.php.net to get a copy of this message
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" <tometerlaks@hotmail.com> wrote in message news:20020320094008.82431.qmail@pb1.pair.com... > 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 > > >

« previous php.general (#89373) next »