Hye sexy beautiful people i need help with this. Ok i have some code that connects to MySQL and here it is:
if ($cookie_user!="") {
$keys = array('userid', 'password', 'usergroupid', 'username', 'email');
foreach ($keys as $key) {
$result= mysql_query("SELECT * FROM user WHERE username='$cookie_user'");
$session[$key]= (mysql_result($result,0,$key));
}
}
so as you can see it works correctly when cookie_user has a correct name in it, what i need help with is getting it so that if its blank or the username is not in the db is will print a default like "guest" instead of 4 errors... can any one help me?