Mam takie funckje które pobierają mi 4 obrazy z galerii:
<?php
function rotator()
{
$result = mysql_query("SELECT id,cat,sub_cat,name,title,width,height FROM $gal_b_tbl ORDER by rand()");
$pic_url = 'uploads/galery/'.$r->cat.'/'.$r->sub_cat.'/'.$r->id.'.'.$r->name;
echo '<a href="'.$pic_url.'" width="'.$r->width.'" height="'.$r->height.'"><img src="http://86.111.247.16/~ekonnnet/uploads/galery/'.$r->cat.'/'.$r->sub_cat.'/minis/tn_'.$r->id.'.'.$r->name.'" border="0" style="cursor: hand"></a>';
}
function rotator2()
{
$result = mysql_query("SELECT id,cat,sub_cat,name,title,width,height FROM $gal_b_tbl ORDER by rand()");
$pic_url = 'uploads/galery/'.$r->cat.'/'.$r->sub_cat.'/'.$r->id.'.'.$r->name;
echo '<a href="'.$pic_url.'" width="'.$r->width.'" height="'.$r->height.'"><img src="http://86.111.247.16/~ekonnnet/uploads/galery/'.$r->cat.'/'.$r->sub_cat.'/minis/tn_'.$r->id.'.'.$r->name.'" border="0" style="cursor: hand"></a>';
}
function rotator3()
{
$result = mysql_query("SELECT id,cat,sub_cat,name,title,width,height FROM $gal_b_tbl ORDER by rand()");
$pic_url = 'uploads/galery/'.$r->cat.'/'.$r->sub_cat.'/'.$r->id.'.'.$r->name;
echo '<a href="'.$pic_url.'" width="'.$r->width.'" height="'.$r->height.'"><img src="http://86.111.247.16/~ekonnnet/uploads/galery/'.$r->cat.'/'.$r->sub_cat.'/minis/tn_'.$r->id.'.'.$r->name.'" border="0" style="cursor: hand"></a>';
}
function rotator4()
{
$result = mysql_query("SELECT id,cat,sub_cat,name,title,width,height FROM $gal_b_tbl ORDER by rand()");
$pic_url = 'uploads/galery/'.$r->cat.'/'.$r->sub_cat.'/'.$r->id.'.'.$r->name;
echo '<a href="'.$pic_url.'" width="'.$r->width.'" height="'.$r->height.'"><img src="http://86.111.247.16/~ekonnnet/uploads/galery/'.$r->cat.'/'.$r->sub_cat.'/minis/tn_'.$r->id.'.'.$r->name.'" border="0" style="cursor: hand"></a>';
}
?>
Teraz mam taki problem jak to zrobić żeby każde z tych zdjęć było inne proszę o pomoc w kodzie.