<?php

include ("setup.php");



$sql = "select * from galeriafotos where supercategoria = '$supercat' and categoria = '$cat' and subcategoria = '$subcat' and id = '$id'";
$result = mysql_query ($sql);
while ( $valor = mysql_fetch_array($result) )
      {
        if($result == TRUE)
        {

echo'

<img src="images/'.$valor["foto"].'" border="0">

<br>
<font size="2">
'.$valor["textocompleto"].'
</font>
<br><br>

';

        }

      }//end while



?>