Hey there
so i just got started with php and im actually quite amazed with it and how easy it is to understand
anyways, right now im trying to do some coding, where i want the script to check if the user exist, if the user exist it will show some info from the server if not it will print "User not found"

this is what i got so far

while ($db_field = mysql_fetch_assoc($result)) {
if (!$result) {
$err=mysql_error();
print $err;
exit();
}
if ($db_field['MemberName'] == null)
{
print "test";
}
else
{
print "[MemberName]" . $db_field['MemberName'] . "[/MemberName]<BR>";
print "[BGsWon]" . $db_field['BGsWon'] . "[/BGsWon]<BR>";
print "[ExpGotten]" . $db_field['ExpGotten'] . "[/ExpGotten]<BR>";
}
}

what do i have to do to check for it :P?

This look like broken design of code for me. Firstly,you check the existence of $result in the loop where you are using the variable. This will probably come with plenty of errors if the variable is not initialize.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.