Dude, are you trying to use javascript with the php?
Instead of using javascript the way you want - make the php echo the results for you.
Another thing is - you can optimize your query to the mysql db, as I see you want a single cell from the table to be displayed. Instead retrieving all records using * in the select statement, better do it like this.
$result = mysql_query("select html from sponsor");
$rows = mysql_num_row($result) -> this will give you information how many records you have in the db.
if ($rows=0)
{ echo 'No sponsors at this time!
';}
else
{
echo '';
for ($i=0; $i<$rows; $i++)
{
$text = mysql_result($result, $i); -> you don't need the column name as it is only 1 column
echo " /n /t$text /n /t";
}
}
echo '';
And that's that.
Try it and advise what happens.