I'm fairly new to PHP and MySQL, and I've been reading A TON, but I havent found anything like what I'm trying to do... I have the following code
$sql = "SELECT * FROM ".$tablename." WHERE day '".$dayNumber."'";
$rs2 = mysql_query($sql,$conn);
while ($row = mysql_fetch_array($rs2))
{
echo ("day: ".$row["day"]." ");
echo ("month: ".$row["month"]." ");
echo ("year: ".$row["year"]." ");
echo ("login: ".$row["login"]."<br>");
}
as you can see this prints out all the data in the table but that's not important. I know I can retrieve the data if it's there but what if i wanted to test to see if there was data there or not - especially relating to the day field?? For example, if I queried for a certain day and it didnt exist then I'd like to display one thing, otherwise I'll use the data returned. Thanks in advance for any ideas!