SEE Kevin's post above as well ... this may make a difference as well..
<?php
$username="name";
$password="pass";
$database="db";
$connection = mysql_connect(localhost,$username,$password);
@mysql_select_db($connection, $database) or die( "Unable to select database");
if ($submit) {
$query="select DISTINCT username, user_password FROM phpbb_user_group, phpbb_users WHERE (phpbb_user_group.group_id= '4') AND (phpbb_user_group.user_id= phpbb_users.user_id) ORDER BY `username` ASC";
$result=mysql_query($connection, $query);
while ($row=mysql_fetch_array($result)) {
if ($row["password"]==$user_password){
echo "Successfully Logged In!";
}
}
}
?>
Try that and see if that doesnt help if it doesnt post and I will look at it more in depth