<?

include "../config.php";

$sql = mysql_query("SELECT id FROM tlinks");
while($each = mysql_fetch_array($sql)) {

	$query4 = "select count(*) as counter from tlviews where tlid=".$each['id'];
	$result5 = mysql_query ($query4) or die ("Query 4 failed");
	$line5 = mysql_fetch_assoc($result5);
	mysql_query("UPDATE tlinks SET sent = '".$line5["counter"]."' WHERE id = '".$each['id']."'");
				
}
		
	
?>