Pay close attention to the line below that you pasted in your first post:
printf("<a href=\"%s?day=%s\">%s %s</a><br>\n", "file.php",
$myrow["day"]);
If you find a variable called $date anywhere there, you are incredible. If you find a variable called $day, then maybe you should check for that instead of $date, as you are in second post.
Does it matter waht you call a variable? Depends, if you want to see it, yea, calling it by it's correct name will work. If you don't, as it appears in this example, then you will not see it.