I tried your script and it worked BUT...
the first time it shows I need the $picture variable to be used as a filename that I pull out of a mySQL data table... something like $picture.jpg I'm just having problems with the quotation marks and stuff... Take alook at the following script and show me how to do it appropriatly so that instead of picture1.jpg I want something like ($picture).jpg and so on and so forth. ALSO, I'm having problems with the PATH. My pictures are in a directory called "pics" and the thumbnails are in "pics/thumbs" how do I write it without messing up?
<?php
include("dbinfo.inc.php");
$db = mysql_connect("$database", "$username", "$password");
mysql_select_db("database",$db);
$result = mysql_query("SELECT * FROM items WHERE pic1='$picture'",$db);
$num = mysql_numrows($result);
?>
<?
$i=0;
while ($i < $num) {
$picture=mysql_result($result,$i,"pic1");
$picture2=mysql_result($result,$i,"pic2");
$picture3=mysql_result($result,$i,"pic3");
switch($picture)
{
default :
case 1 : echo "<IMG border=0 src=\"picture1.jpg\">";
echo " ";
echo "<A href=\"switchpics.php?picture=2\"><IMG border=0 src=\"picture2.jpg\"></A>";
echo " ";
echo "<A href=\"switchpics.php?picture=3\"><IMG border=0 src=\"picture3.jpg\"></A>";
break;
case 2 : echo "<IMG border=0 src=\"picture2.jpg\">";
echo " ";
echo "<A href=\"switchpics.php?picture=1\"><IMG border=0 src=\"picture1.jpg\"></A>";
echo " ";
echo "<A href=\"switchpics.php?picture=3\"><IMG border=0 src=\"picture3.jpg\"></A>";
break;
case 3 : echo "<IMG border=0 src=\"picture3.jpg\">";
echo " ";
echo "<A href=\"switchpics.php?picture=2\"><IMG border=0 src=\"picture2.jpg\"></A>";
echo " ";
echo "<A href=\"switchpics.php?picture=1\"><IMG border=0 src=\"picture1.jpg\"></A>";
break;
}
?>