Re: MySQL database query passwort and username

From: Date: Thu, 29 Apr 2010 11:44:54 +0000
Subject: Re: MySQL database query passwort and username
References: 1  Groups: php.windows 
Request: Send a blank email to php-windows+get-30058@lists.php.net to get a copy of this message
> Hello, > > i am writing a login script with php and mysql: > > while($dbbenutzer = mysql_fetch_row($sqlbenutzername)) > while($dbpasswort = mysql_fetch_row($sqlpasswort)){ > > > echo $dbbenutzer[$i]; > echo $dbpasswort[$j]; > if($benutzername == $dbbenutzer and $pass == $dbpasswort){ > echo '<p>Sie haben sich erfolgreich angemeldet</p>'; > echo '<a href="willkommen.html">Willkommen</a>'; > } > } > > } > > I have the username=benutzername in one column and the > password=passwort in the oher column. > Now i use mysql_fetch_row to go through the columns and try to compare > the values given by sql select statement > with the values provided by the user. > > The problem is that this code only finds the firs entry moritz and > 123456 and not the second. There are two values in the database morith > 123456 and thomas thorr. These are sample values for testing only. > > Is there an easier way to write a login script? You will get more answers asking your questions in the database mailing list php-db@lists.php.net, rather than in a list for Windows related matters. > thank you > Alexander > > -- > PHP Windows Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php -- Niel Archer

« previous php.windows (#30058) next »