I have already managed to store the visitors IP address and assign them an ID (1, 2, 3, etc.) and I want to display different messages to them. The code I have so far is this:
function DisplayWelcomeMessage() {
$checkUserIDExists = mysql_query("SELECT * from Information where id = '$myid'");
if(mysql_num_rows($checkUserIDExists) < 0) {
return '<div class="Message">New visitor message</div>';
} else {
return '<div class="Message">Returning visitor message</div>';
}
}
When I use this code, it always displays the returning visitor message.