From: Alexander Schunk on 29 Apr 2010 05:26 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? thank you Alexander
From: Niel Archer on 29 Apr 2010 07:44 > 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(a)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
|
Pages: 1 Prev: Unable to load php_msql.dll Next: Compiling PHP with MS SQL Server Driver for PHP support |