shahid_hussnain Posted February 12, 2011 Share Posted February 12, 2011 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 https://forums.phpfreaks.com/topic/227422-help-me-plz/ Share on other sites More sharing options...
acefirefighter Posted February 12, 2011 Share Posted February 12, 2011 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 https://forums.phpfreaks.com/topic/227422-help-me-plz/#findComment-1173074 Share on other sites More sharing options...
shahid_hussnain Posted February 12, 2011 Author Share Posted February 12, 2011 all records are displayed but image item value (pic) are not display...... thanks Link to comment https://forums.phpfreaks.com/topic/227422-help-me-plz/#findComment-1173082 Share on other sites More sharing options...
acefirefighter Posted February 12, 2011 Share Posted February 12, 2011 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 https://forums.phpfreaks.com/topic/227422-help-me-plz/#findComment-1173090 Share on other sites More sharing options...
shahid_hussnain Posted February 12, 2011 Author Share Posted February 12, 2011 thanks u give me hints its very usefull for me, i mistake ididt copy images in web server. sorry i m oracle developer and making a shopping cart to my cousion! i tried but i will do it. thanks Link to comment https://forums.phpfreaks.com/topic/227422-help-me-plz/#findComment-1173092 Share on other sites More sharing options...
acefirefighter Posted February 12, 2011 Share Posted February 12, 2011 Ok, good luck. Link to comment https://forums.phpfreaks.com/topic/227422-help-me-plz/#findComment-1173095 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.