Don't use mysql_db_query() for one. Use mysql_select_db() and mysql_query().
Also, what's the structure of your table and how are you putting the user's login and password in the table. If you're getting that message, then that means there were no rows matched, plain and simple. It could be for a variety of reasons. You might want to echo out the query before you execute it just to make sure it's what you think it is. ---John Holmes... > -----Original Message----- > From: Mr. BuNgL3 [mailto:mrbungle@;netcabo.pt] > Sent: Sunday, November 03, 2002 9:43 AM > To: [EMAIL PROTECTED] > Subject: [PHP] what i'm doing wrong? (mysql/php) > > I can't validate this two variables ($logintxt, $passwdtxt) > > <? > $logintxt = $HTTP_POST_VARS['logintxt']; > $passwdtxt= $HTTP_POST_VARS['passwdtxt']; > > if (!$logintxt || !$passwdtxt) > { > include('login.htm'); > } > else > { > $ligacao=mysql_connect("localhost","",""); > if (!$ligacao) > { > echo " > <html> > <title>ERROR!!</title> > <body>Problemas na liga��o � base de dados!</body> > "; > } > else > { > $pass=md5($passwdtxt); > $sql="SELECT login,passwd FROM users WHERE (login='$logintxt') && > (passwd='$pass')"; > $result=mysql_db_query("mysite",$sql) or die (mysql_error()); > if ($result) > { > $reg=mysql_fetch_array($result); > if ($pass==$reg["passwd"] && $logintxt==$reg["login"]) > { > echo " > <html> > <title>Xaram!!</title> > <body>User logged in</body> > "; > } > else > { > echo " > <html> > <title>ERROR!!</title> > <body>User n�o existente ou inv�lido</body> > "; > } > > } > else > { > echo " > <html> > <title>ERROR!!</title> > <body>No result</body> > "; > } > > > } > mysql_close(); > } > ?> > > it keeps telling me "User n�o existente ou inv�lido" i guess that the > problem is in the line code "if ($pass==$reg["passwd"] && > $logintxt==$reg["login"])" but i can't figure it out!! what i'm doing > wrong? > > Thanks for the help... > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

