così funziona:

Codice PHP:
<images>
<?

$dir 
"admin/photos/uploads/thumbs/";

if (
is_dir($dir)) {

    if (
$dh opendir($dir)) {
    
        while ((
$file readdir($dh)) !== false) {

            
$filetype substr($file,-3);
            
$filetype strtolower($filetype);
                        
            if (
$filetype == "jpg" || $filetype == "gif") { ?>
    <pic>
        <image>admin/photos/uploads/thumbs/<? echo $file;?></image>
        <caption><? echo $file;?></caption>
    </pic>
<?            
            
}
        }
        
closedir($dh);
    }
}
?>
</images>
se aggiungo la query
Codice PHP:
$sql "select * from photos where ptid = "$_REQUEST['id'] . " order by porder asc";
    
$photo mysql_query($sql,$myconn) or die(mysql_error()); 
già non funziona più


Codice PHP:
<images>
<?
$sql 
"select * from photos where ptid = "$_REQUEST['id'] . " order by porder asc";
    
$photo mysql_query($sql,$myconn) or die(mysql_error()); 

$dir "admin/photos/uploads/thumbs/";

if (
is_dir($dir)) {

    if (
$dh opendir($dir)) {
    
        while ((
$file readdir($dh)) !== false) {

            
$filetype substr($file,-3);
            
$filetype strtolower($filetype);
                        
            if (
$filetype == "jpg" || $filetype == "gif") { ?>
    <pic>
        <image>admin/photos/uploads/thumbs/<? echo $file;?></image>
        <caption><? echo $file;?></caption>
    </pic>
<?            
            
}
        }
        
closedir($dh);
    }
}
?>
</images>
come devo inserire la query per far si che mi carica le immagini riferite all'id della pagina?

la struttura della tabella photos è:

id ptype ptid caption porder location
28 ITEMS 56 2 1 33454.jpg

la pagina che aprirò per visualizzare lo slideshow è pagina.php?id=56

cosa manca allo script per funzionare a parte la query?:

Codice PHP:
$sql "select * from photos where ptid = "$_REQUEST['id'] . " order by porder asc";
    
$photo mysql_query($sql,$myconn) or die(mysql_error());