<?

	$res=mysql_query("select count(id) from tb_textads where play = '0'");
	$kolvo=mysql_result($res,0,0);
	$i=(int)rand(1,$kolvo);

	$res=mysql_query("select * from tb_textads where play = '0' order by id asc");

	for($j=1;$j<=$i;$j++) $row=mysql_fetch_assoc($res);

	$url=$row["url"];
	$adstext=$row["text"];

	echo "$adstext";

?>