Hi everyone.
I am trying to make an if statment that will show text saying create an album if the user has no albums but if they have one or more albums then it will show their albums. Now I have sorted out everything but when I get to the if section of it it shows the two things I described above. I have tried different ways of doing the if function but it just won't work. Here is the code. Any help would be much appreciated
$album_num = mysql_num_rows(mysql_query("SELECT * FROM albums WHERE userid = '" . $id . "'"));
if($album_num==0)
{
echo "You have no albums. <br /> <a href='albums.php'>Create One?</a>";
}
else
echo"<b>Recent Albums</b><br />
<font size='2'>";
echo"<table width='50%'>";
while ($row = mysql_fetch_assoc($album))
{
echo "<font face='arial' size='3'><tr>
<td>
<img src='store/".$row['cover']."' width='160' height='100'>
</td>
<td>
<b><a href='viewalbum.php?album=".$row['id']."'>".$row['name']."</a></b>
<br />".$row['description']."<br />
</td></tr></font>";
}
echo"</table>";