PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
$query = "SELECT UserId, FirstName, LastName, UserName, Password FROM User WHERE User.UserName =
'".$_POST["username"]."' AND User.Password = '".$_POST["password"]."'";
$result = mysql_query($query) or die('Query failed');
if (mysql_fetch_row($result)){
$cnt = mysql_num_rows($result);
$row = mysql_fetch_array($result);
while($row = mysql_fetch_array( $result )) {
echo $row['FirstName']; [b]<------------ This doesn't work[/b]
}
}
Last edited by Benjamin on Wed Nov 23, 2011 6:17 am, edited 1 time in total.
Reason:Added [syntax=php||htm||css||javascript||sql||etc] - Please use [syntax] tags when posting code in the forums! Thanks.