<?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>
	');
$reel=0;

while ($reel < 110) {
	$select= "SELECT * FROM `testTJG2` WHERE (reel=$reel)"; 
        $result=@mysql_query($select) or die('The search on '.$reel.' failed; please try again in a minute or contact the webmaster.');	
	$reel++;

	$current = mysql_fetch_array($result);
	$title = $current["title"];
	$date = $current["date"];
	$description = $current["description"];
	$desc = substr($description,0,80);
	$filename = $current["url"];
	$tempname = split("-", $filename);
	print $tempname[0];
	$firstbit = $tempname[0];
	$firstchar = substr_replace($firstbit, "", -1);
	print $firstchar;
	$firstchar++;
	if($filename){			

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

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

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

?>