I am making a script that catalogues my photogalleries and the thumbnail is a random picture chosen from the galleries /thumb directory. It all seems to work, but the directory of each gallery is stored in mysql (example: ../images/galleries/picnic05/thumbs) that info and equals $directory and randomly changes file name that equals $image
<img src="'.$directory.'/'.$image[$randNum].'" $size[3] border="0">
The problem is that on the second table entry it randomly pics filenames from the first gallery and the second one.
I know this must sound really confusing, but I want it to kinda reset the script everytime a new row is created using while.
Here where the file is displayed.
http://www.crazyclimber.no-ip.com/site1/galleries.php
These are the two files it uses.
http://www.crazyclimber.no-ip.com/site1/php/postgallery.txt
http://www.crazyclimber.no-ip.com/site1/php/randomimage.txt
Thanks for any help you can give me.
Scotty