deansaddigh Posted November 18, 2009 Share Posted November 18, 2009 I have an image location being pulled from db buts its not comming out on page, can anyone help. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <?php include '../includes/connection.php'; ?> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="shortcut icon" href="../images/animated_favicon1.gif" /> <link rel="stylesheet" type="text/css" href="../css/layout.css" /> <link rel="stylesheet" href="../css/lightbox.css" type="text/css" media="screen" /> <script type="text/javascript" src="../js/prototype.js"></script> <script type="text/javascript" src="../js/scriptaculous.js?load=effects,builder"></script> <script type="text/javascript" src="../js/lightbox.js"></script> <title>Nextdayfrags.co.uk</title> </head> <body> <!--wrapper to hold site--> <div id="wrapper"> <!--Logo holder--> <div id="header"></div> <div id="left"> <div class="nav"> <ul> <li><a href="#">SPS frags</a></li> <li><a href="#">LPS frags</a></li> <li><a href="#">Soft Coral frags</a></li> <li><a href="#">Coral Frag packs</a></li> <li><a href="#">SPS Coral Colonies</a></li> <li><a href="#">LPS Coral Colonies</a></li> <li><a href="#">Anemones</a></li> <li><a href="#">Clean Up Critters/ Inverts</a></li> <li><a href="#">Coral Food</a></li> <li><a href="#">Reef Accesories</a></li> <li><a href="#">Gift Vouchers</a></li> </ul> <div align="center"> <img src="../images/paypal.png" alt="Paypal verified" /> </div> </div> </div> <div id="right"> <p>Welcome to Nextdayfrags.com We offer a variety corals, critters and select dry goods through our online store. Whether you're searching for healhty, colourful SPS coral frags or wanting to add some movement that LPS corals provide, here at mailordercorals, we have you covered. With new shipments arriving all the time, we highly recommend you subscribe to our newsletter, that way you can stay updated - and we may just have some exclusive offers for our mailing list members. Here at mailordercorals, we aim to offer the very best in customer service and all our livestock comes with our live arrival guarantee, so whether you are a complete novice starting out or an old seasoned reefkeeper, we know you will find something that interests you from our ever growing online catalogue. Don't forget you can also order over the phone (Sales Hotline: 01383 428590) or come visit our Coral house (by appointment only). What are you waiting for? Check out the latest additions to our online catalogue below: </p> <object width="425" height="350" type="application/x-shockwave-flash" data="http://www.reefvids.com/player/player.swf"><param name="movie" value="http://www.reefvids.com/player/player.swf"><param name="flashvars" value="&file=http://www.reefvids.com/xml_playlist.php?id=14&height=350&image=http://www.reefvids.com/thumb/4ca4238a0b/14.jpg&width=425&location=http://www.reefvids.com/player/player.swf&logo=http://www.reefvids.com/templates/images/watermark.gif&link=http://www.reefvids.com&linktarget=_blank"/></object> <?php $query = "select * from product"; $result = mysql_query($query, $conn) or die ("Unable to perform query"); echo '<table border ="2">'; echo '<tr>'; echo '<th> Product Name </th>'; echo '<th> Product Category</th>'; echo '<th> Product Price</th>'; echo '<th> Product Description</th>'; echo '</tr>'; while($row= mysql_fetch_array($result)) { //Get the course id so that can compare the id with the id of the unique to find the relevant section.. $productname = $row['ProductName']; $productcategory = $row['ProductCategory']; $productprice = $row['ProductPrice']; $productdescription = $row['ProductDescription']; ?> <tr> <td><?php echo $productname;?></td> <td><?php echo $row['ProductCategory'];?></td> <td><?php echo $row['ProductPrice'];?></td> <td><?php echo $row['ProductDescription'];?></td> </tr> <?php } //----------------------------------------------------------------------------------- $query = " SELECT * FROM image ORDER BY ImageID DESC"; $result = mysql_query($query) or die('Error, query failed'); //Open the table echo '<table>'; echo '<tr>'; // print the pictures into a table - assign how many per row while($row = mysql_fetch_array($result)) { $imagename = $row["ImageName"]; $imagepath = $row["ImagePath"]; echo $file = $imagepath.$imagename; echo '<td>'; //echo '<td> <img src="'.$file.'" /> </td>'; echo '<img src="'.$file.'"/>'; echo '</td>'; echo '</tr>'; } echo '</table>'; //----------------------------------------------------------------------------------- ?> </div> </div> </body> </html> Link to comment https://forums.phpfreaks.com/topic/182046-why-is-my-image-not-displaying/ Share on other sites More sharing options...
Ken2k7 Posted November 18, 2009 Share Posted November 18, 2009 Hello deansaddigh, Does the "echo $file = $imagepath.$imagename;" line print out the correct result? Ken Link to comment https://forums.phpfreaks.com/topic/182046-why-is-my-image-not-displaying/#findComment-960299 Share on other sites More sharing options...
deansaddigh Posted November 18, 2009 Author Share Posted November 18, 2009 Yes it does indeed it prints out this Product_image/Ebene_16.jpg put it actually prints that on the screen as appose to the actual image Link to comment https://forums.phpfreaks.com/topic/182046-why-is-my-image-not-displaying/#findComment-960309 Share on other sites More sharing options...
tommy20 Posted November 18, 2009 Share Posted November 18, 2009 You need to put in img scr like you do in html and have the source as the $file Link to comment https://forums.phpfreaks.com/topic/182046-why-is-my-image-not-displaying/#findComment-960350 Share on other sites More sharing options...
Ken2k7 Posted November 18, 2009 Share Posted November 18, 2009 deansaddigh, In relation to the file, where is the image located? Ken Link to comment https://forums.phpfreaks.com/topic/182046-why-is-my-image-not-displaying/#findComment-960391 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.