i need to send a message to a receiver, if the user not in the database, echo the "Unknown user", if the user is in the database, then the message will be sent to the receiver
although i use mysql_fetch_row, mysql_fetch_array, mysql_fetch_assoc, mysql_fetch_field, mysql_num_fields, mysql_num_rows
it just shows "Unknown user".....
hope you all can teach me...
thank you..
$result = mysql_query("SELECT username FROM ".$DBprefix."signup WHERE username='$nickname'") or die(mysql_error());
if (mysql_fetch_field($result) != $adres) {
echo"Unknown user";
} else {
$datetime = date("Y-m-d G:i:s ");
$query = mysql_query("INSERT INTO ".$DBprefix."inbox (messageID,adres,sender,DateRecieved,title,message,isRead) values ('','$adres','$nickname','$datetime','$subject','$content','')");
echo"Your message has been sent to $adres";
}
}
$result = mysql_query($query);