Images and PHP

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • LindaM
    New Member
    • Jan 2007
    • 1

    Images and PHP

    Hello, I'm new to PHP and thescripts.com. I'm trying to edit a website with a database and photos. Users can upload a photo with data(php, database and scripts are all in place). I want to be able to let the user upload more than 1 photo for that specific item. Seems like a simple fix but I can't seem to figure it out. Below is code for uploading 1 photo.

    <img width="180" src="<?=($vehic leAddition->hasPhoto ? ($vehicleAdditi on->originalPhot o ? getAutoThumbnai l($vehicleAddit ion->vid) : getNewSessionTh umbnail()) : "images/thumb_nophoto.g if")?>"/>
  • BeRtjh
    New Member
    • Jan 2007
    • 12

    #2
    [PHP]$query = "SELECT photo FROM table_name";
    $result = mysql_query($qu ery);
    while(list($pho to) = mysql_fetch_row ($result)){
    if (is_string($pho to)){
    $insert = "; $photo_name";
    $query2 = "UPDATE table_name SET photo='".$inser t."'";
    mysql_query($qu ery2);
    }else{
    $insert = "$photo_nam e";
    $query3 = "UPDATE table_name SET photo='".$inser t."'";
    mysql_query($qu ery3);
    }
    }[/PHP]

    now its possible , when you get your result from your db, to search your string for ; with explode..


    [PHP]explode(";", $photo_url);
    echo $photo_url;
    [/PHP]

    Comment

    Working...