Sorry, I don't know much of MYSQL, so I cannot help you, sorry. But this is kind of p]weird. :/
";
$q=mysql_query("SELECT * FROM ads ORDER BY rand() LIMIT 1",$c);
if(mysql_num_rows($q))
{
}
print "<table width=100%><tr><td width=20% valign='top'>
";
Maybe try? o_0
// Put what ever come before this is.
$Query = mysql_query("SELECT * FROM `ads` ORDER BY rand() LIMIT 1" , $c) or die('Mysql error!'); // Try to select WHAT'S needed
if (mysql_num_rows($Query) )
{ // Opening
print "<table width = '100%'>
<tr>
<th>????</th>
</tr>
<tr>
<td width = '20%' valign='top'>WHAT EVER HERE</th> // IOutput here.
</tr>
</table>";
} // Closing
I think the table should be included there(fully). If some things are there(in the table) that arn't needed. Just remove.