I hope the title explains well, but i am having trouble, a) finding any reference to what i am looking to do, and b) figuring out the logic in my head, so all input, even if simply pointing me in the direction of the correct syntax, would be a great help.
my aim is this - each user i have has the ability to upload 10 photos. i want to show each users photos within a preset template, with all users "template" showing up in a list on one page, ie ill have user ones ten photos in the template, then immediately below ill have user twos, and so on down the list.
i have already designed the template, and i am able to populate it based on the current logged in user id, but i am having difficulty making it appear for EVERY user, so that every user can see each others photos.
i have tried:
$everyid = array($user_id) foreach ($user_id as $value) {include 'template.php';}
but this doesnt work so it would seem to be very wrong. in short, i guess i want to pick up each user_id in the database, check if they have photos uploaded (apply other parameters, but i wont go into that here since i should be able to sort that myself after), and then output their own templated area to a certain page if its relevant.
please bear in mind that i have all the photos path's entered to the mysql table in the relevant user's column, so there may be an easier way to autogenerate this content that im overlooking, so any suggestions of how to do this are welcome.
thanks.
EDIT: can provide template code and the like if necessary, but theyre long winded and would expand the page a great deal.
EDIT EDIT: as requested, here is how my able is set up (in simplified form):
user_id username image1 image2..... and so on.
1 her eduejdksk.jpg werfwer9342.jpg
2 him 234234234.jpg null
here is my sample code:
$user_id = $_SESSION['user_id'];
$queryone = mysql_query("SELECT `image1` FROM `users` WHERE `user_id` = $user_id");
$resone = mysql_fetch_array($queryone);
$valueone = $resone['image1'];
<div id="imageone">
<?php
if($valueone != '') {
echo '<img src="uploads/', $user_id, '/thumbsbig/', $valueone, '">';
} else { ;}
?>
</div>
which enables me to, successfully, assuming "her" is logged in, recall image1 for "her" (eduejdksk.jpg) into a template based on the logged on user. what it doesnt allow me to do, is show said file in one template, and then 234234234.jpg in another immediately below.
as you can see it uses the session user id to pick the photos from the db. what i want to happen is for $user_id to equal 1 then 2 then 3 and so on...for the complete database of users. i am assuming its some sort of while or foreach loop, but as per above my efforts have, as of yet, been fruitless.
thanks.