Jump to content

Image list download code needs fix.


artworthy

Recommended Posts

I'm trying to create a series of images on a page but the code won't run. (left table code out):

 

<body>

<?PHP

 

/// fyi, the image_link field contains, e.g., artistfoldername/imagefilename.jpg

 

$path = "artWorkImages/";

$art_id ='2';

 

    $QUERY="SELECT art_title, about_art, image_link FROM artWork WHERE art_id = '$art_id'";

    $res = mysql_query($QUERY);

$num = mysql_num_rows($res);

if($num>0){

 

while($row = mysql_fetch_array($res)){

$artist_name = $row["art_title"];

$about_art = $row["about_art"];

      $image_link = $row["image_link"];

 

print "<img src=$path.$image_link/>";

 

}

}

 

?>

</body>

 

Thanks

Allen

 

 

Link to comment
Share on other sites

Thanks for replying -- though it didn't work.

FYI - the page does give me 1 text row of art_title (instead of 3) when it simply reads:

 

while($row = mysql_fetch_array($res)){

$art_title = $row["art_title"];

$about_art = $row["about_art"];

      $image_link = $row["image_link"];

 

echo $art_title;

 

thoughts

 

Link to comment
Share on other sites

Thanks Litebearer! Your help lead me to this which works fine:

 

<table width="100%" border="0" cellpadding=".2em" class="smGrayfont">

<?PHP

/// fyi, the image_link field contains e.g., artistfoldername/imagefilename.jpg

 

$path = "http://xxxxxx.net/xxxxxxxxx/artWorkImages/";

// $path = "../artWorkImages";

$art_id ='2';

 

    $QUERY="SELECT art_title, about_art, image_link FROM artWork WHERE art_id = '$art_id'";

    $res = mysql_query($QUERY);

$num = mysql_num_rows($res);

if($num>0){

 

while($row = mysql_fetch_array($res)){

$art_title = $row['art_title'];

$about_art = $row['about_art'];

      $image_link = $row['image_link'];

 

          echo "<tr align=\"justify\" height=\"100\">

                <td align=\"left\"> <img src=\"$path/$image_link\" height=\"75\" width=\"75\"></td>

<td align=\"left\">$art_title

                  $about_art</td>

</tr>";

}

}

 

?>

</table>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.