Boboc 0 Newbie Poster

If anyone can help me I would be most grateful, Im curently working on a website at the minute that uses images that have been uploaded to a directory, along with a location reference in a MYSQL database.

I have currently got the page to show the thumbnail version of the image, however I want the user to be able to click on the image, and for the image to appear above the thumbnails, the starting image above the thumbnails would be the first result of the mysql query.

I presume this would require Javascript to succeed, however, I have no idea how to go along with this, the code I have so far is :

<?php require ('scripts/connect.php');?>
<?php require("styles/top.php"); ?>


	<div id='full'>
		

		<?php

		$album_id = $_GET['album_id'];
		echo "<h3>View Album - $album_id</h3><br>";
		
		$query = mysql_query("SELECT * FROM album WHERE album_id='$album_id'");
		$numrows = mysql_num_rows($query);
		if ($numrows == 1){
			$row = mysql_fetch_assoc($query);
			$site_id = $row['user_id'];
			
			
		
		}


$image_query = mysql_query("SELECT image_id, album_id, timestamp, ext
FROM image
WHERE album_id = '$album_id'
AND site_id = '$site_id' ");

 echo "<a href = 'manage_images.php?id=$site_id'>Back to image home</a><br><br>";

$nextColumn=1;
echo "<image src = 'imagesUploaded/defavatar.png' width = '200px' height = '200px'> </img>";
echo "<br><table><tr>";  
while ($row1 = mysql_fetch_assoc($image_query)){
		$image_id = $row1['image_id'];
		$timestamp = $row1['timestamp'];
		$ext = $row1['ext'];
		$album_id = $row1['album_id'];
		$title = $row1['title'];


		$thumbsLocation = "uploads/thumbs";
		$thumbsLocation2 = "uploads";
		$backS = "/";
		$dot = ".";
		$image_location = $thumbsLocation.$backS.$album_id.$backS.$image_id.$dot.$ext;
		$image_location2 = $thumbsLocation2.$backS.$album_id.$backS.$image_id.$dot.$ext;
		
		$get = mysql_query("SELECT image_id, album_id, timestamp, ext FROM image WHERE album_id = '$album_id' AND site_id = '$site_id' ");
	$nr = mysql_num_rows($get); // Get total of Num rows from the database query
		
	$size = "80px";
	
	if($nr < 3)
	{
	$size = "60px";
	}
	
	if($nr > 5)
	{
	$size = "29px";
	}
	
	
		

 
    echo "<td><img src='$image_location' width='$size' height='$size'></img></td>"; 
$nextColumn++;
if($nextColumn>6)
{
echo "<tr>";
$nextColumn=1;
}
  

		
}
echo '</tr></table>';


	?>