Ok, the error says that no result has been returned from sql. This may be caused either by no data in tables or by a wrong sql statement.
I suggest you to put this line just after $result=mysql_query($sql);
if (!$result)
{
die mysql_error();
}
If this does not return an error, then your tables are empty, or your sql is valid, but returns no records.
I think that you need to revise your sql statement though.
I don't really get the idea of this statement
SELECT * FROM `textads` WHERE `expos` GREATER THAN `xCount` ORDER BY RAND() LIMIT 3
First of all, I would remove the useless quotes around the column names and table name.
Then - greater than, you can just use '>' sign.
Next, what do you mean by setting an ordering which uses RAND() function - you want to randomize your results or what?
And last - LIMIT 3 - the limit clause normally should be used like
Limit "# of records to omit, # of records to return". So if you want to see only the first 3 records only, LIMIT 0,3 should be used instead.