Jump to content

help me plz!


shahid_hussnain

Recommended Posts

hi

i m new in php, i design a shopping cart.

I saved a image file name in mysql and image physical store in filesystem.

.......................................

<body>

<p>

  <?php do { ?>

    <?php echo $row_Recordset1['prod_image']; ?><br />

    <?php echo $image_filename = "_images/". $row_Recordset1['prod_image'].".jpg"; ?><br />

    <img src="<?php echo trim($image_filename); ?>" alt="image logo" name="image1" width="223" height="73" id="image1" style="background-color: #FFCCCC" /><br />

    <br />

<br />

    <?php } while ($row_Recordset1 = mysql_fetch_assoc($Recordset1)); ?>

</p>

</body>

.....................................

script has no errors, problem is i get filename  from database but i run the script, it comes display one image(first record) from filesystem and rest of record image are not display.

i tried image or image placeholder.

 

regards

Shahid Hussnain

Link to comment
Share on other sites

I am really not sure what it is your going for but I think I interpreted enough to get you this.

<body>
<p><?php
while ($row_Recordset1 = mysql_fetch_assoc($Recordset1)) {
echo $row_Recordset1['prod_image'] . '<br />'; 
    
$image_filename = trim("_images/". $row_Recordset1['prod_image'].".jpg");
    echo '<img src="'.$image_filename.'" alt="imagelogo" name="image1" width="223" height="73" id="image1" style="background-color: #FFCCCC" />';
    echo '<br /><br /><br />';
}
</p>
</body>

 

Link to comment
Share on other sites

all records are displayed but image item value (pic) are not display......

thanks

 

It may be because your file path isn't right ex...

if your images are stored at http://www.yourSite.com/_images/

and the page you are on is http://www.yourSite.com/california/shopping/

 

then your script is looking for the images in http://www.yourSite.com/california/shopping/_images/

 

Im not sure if that is the case but I would bet on it. your going to have to define more of your path to the image.

 

I pull everything through the my base index.php file so I don't usually have to deal with this. Anyone feel free to chime in if I am wrong.

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.