More arrays

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
pinehead18
Forum Contributor
Posts: 329
Joined: Thu Jul 31, 2003 9:20 pm

More arrays

Post by pinehead18 »

Ok well here i go again. In my quest to expand my knowledge in arrays (and write this script) i've come accross a question.


First off. Let me explain what is going on. I'm write a photo album type system for my family. Each user can upload 5 pictures. So when they login to their page. I have a script which pulls the 5 image names from an array. And creates a link to them.




That is what that script does.

Code: Select all

<?php
$sql = "SELECT * FROM users where user='$name'";
$result = mysql_query($sql) or die(mysql_error());

while($arr = mysql_fetch_array($result))
{
    $pics[] = $arr["add_picts"];
}
foreach($pics as $picid)
{
    $array = explode(',', $picid);

    foreach ($array as $pic)
    {
print $pic[0];
echo "</p>";
print $pic[1];
echo "</p>";
print $pic[2];
        
        
        $table .= "<tr><td><a
href=http://l.com/images/$pic>$pic</p></tr></td>";
        $table_one .= "<td><p align=center><a href=http://c.com/edit_pics.php?picid=$array><img
src=http://c.com/images/$pic height=80 width=80 border=0><br>$pic</a></td><td>&nbsp</td>";
    }
}
?>
This code works great. It even links correctly. However, i face the problem of when the person clicks on the link it is suppose to take you to the upload script page. My problem is i dont' know how to tell the upload script page which $pics[] var in the array to update.

Any suggestions on how to go about this?
User avatar
Lord Sauron
Forum Commoner
Posts: 85
Joined: Tue Apr 20, 2004 5:53 am
Location: Tilburg, NL

Post by Lord Sauron »

When should a picture be updated and when not?
Post Reply