ok,
so I'm working on my new homepage, and I decided I'd replace the Expose flash-gallery I'd make my own gallery, to have the page completly 'homemade'...
Though my knownledge on php isn't too good, I started, and I think I've gotten quite far, now what I'm struggeling with is a category menu at the top, so that I can organize my pictures into categories, without having to make a new html document for each category...

This is how far I've gotten:
Code:
<?php

class Gallery {

var $userstable = "gallery";
var $result;

function DoGallery(){

mysql_connect('localhost','root','')
|| die(mysql_error());
@mysql_select_db('thorbear')
|| die("Unable to select database");

if(!isset($_GET['userstable'])) $notgallery = "notgallery";
	echo '<a href="?userstable='.$notgallery.'"> category </a>';

$query = "SELECT * FROM $this->userstable";
$this->result = mysql_query($query);
$number = mysql_num_rows($this->result);
$i = 0;
if ($number == 0) :
	print "<center><b>No Images? O.o</b></center>";
elseif ($number > 0) :
	while ($i < $number):
		$path = mysql_result($this->result,$i,"path");
		$thumb = mysql_result($this->result,$i,"thumb");
        $alt = mysql_result($this->result,$i,"alt");
		print	"<div class=\"img\">";
		print	"<a href=\"$path\" target=\"_new\">";
		print	"<img src=\"$thumb\" alt=\"$alt\" width=\"110\" height=\"90\" style=\"-moz-opacity:0.4;filter:alpha(opacity=40)\" onmouseover=\"this.style.MozOpacity=1;this.filters.alpha.opacity=100\" onmouseout=\"this.style.MozOpacity=0.4;this.filters.alpha.opacity=40\" />";
		print	"</a>";
		print	"<div class=\"desc\">$alt</div>";
		print	"</div>";
        $i++;
	endwhile;
endif;

mysql_free_result($this->result);
mysql_close();

}
}

$p_obj =& new Gallery;
$p_obj->DoGallery();

?>
the images show properly, just the way I want them to, but I can't make the menu work...any tips? (other improvements are accepted with thx )

thx in advance