<?php

@mysql_connect("mysql.csail.mit.edu","filmsai","filmsAI+3456") or die("Foo!");
@mysql_select_db("filmsAI") or die("Bar!");

	echo ('



	<p><table><tr><td width=5%></td><td>

	<table style="text-align: left; width: 100%;" border="0" cellpadding="0" cellspacing="3">
		<tbody>
		');


$year=1900;

while ($year < 2010) {
	$year++;
	$select= "SELECT * FROM `testTJG2` WHERE (date=$year)"; 

echo('<br>1:'.$select);
        $result=@mysql_query($select) or die('The search on '.$year.' failed; please try again in a minute or contact the webmaster.');	
echo('<br>2:'.$result);

	
	$current = mysql_fetch_array($result);
	$title = $current["title"];
	$date = $current["date"];
	$description = $current["description"];
	$desc = substr($description,0,80);
	$filename = $current["url"];
	$firstnum = $filename{0} + 1;
	$firstbit = substr($filename, 0, 2);
	$firstchar = (string) $firstnum;



	echo('
				<tr><td>
					<a href="http://projects.csail.mit.edu/films/aifilmsdynamicPage6.php?reel%23='.$firstbit.'&res='.$list.'">'.$filename.'</a>
					<b>'.$title.'</b> : '.$date.'<br>

					'.$desc.'...
					</td></tr>
				
');

}


echo('
		</tbody>
	</table>
	</td></tr></table>
	');

?>
