> -----Original Message-----
> From: chris [mailto:[EMAIL PROTECTED]] 
> Sent: Wednesday, March 20, 2002 3:38 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP] PHP - mssql
> 
> 
> <?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.

In what way isn't it working?  Do you get an error message, or just not
the result you were expecting?

If it's the latter (in particular, if you're getting "correct login" no
matter what values you use for $user and $pass), the issue is likely
related to the fact that mssql_query() returns a result identifier which
doesn't necessarily have any correlation to the contents of the result
set -- it'll only return false if there's an error in your query (and a
query can be error-free and still not return data).

For what you're doing, you'll probably want to take a look at
mssql_num_rows().


---
Mark Roedel           | "Blessed is he who has learned to laugh
Systems Programmer    |  at himself, for he shall never cease
LeTourneau University |  to be entertained."
Longview, Texas, USA  |                          -- John Powell


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to