dazz_club Posted March 16, 2008 Share Posted March 16, 2008 hi guys i am trying to echo out my row that is within an img src, but doesnt seem to work, any pointers?? Here is the code; .......$query = "SELECT * FROM products WHERE name LIKE \"%$search%\" OR category LIKE \"%$search%\" OR image LIKE \"%$search%\" OR type LIKE \"%$search%\" ORDER BY product_id DESC" . " LIMIT $offset, $rowsPerPage" ; $result = mysqli_query ($connection, $query)or die(mysqli_connect_errno() . "<p>With query:<br>$query"); while ($row = mysqli_fetch_assoc($result)){ echo "<ul style=\"font-weight:bold;list-style:none;padding:4px;margin:0px;\">"; echo "<li>"; echo $row['name']; echo "</li>"; echo "<li>"; echo $row['type']; echo "</li>"; echo "<li>"; echo "<img src=\"images/product-images/$row ['$image']\" />"; echo "</li>"; echo "<li>"; echo $row['category']. '<br />'; echo "</li>"; echo "</ul>"; echo "<li><a href=\"#\" style=\"font-size:8pt;color:red;\">more information >></a></li>"; echo "<div style=\"width:100%;height:5px;border-bottom:1px solid black;\"></div>"; kind regards Dazzclub Link to comment https://forums.phpfreaks.com/topic/96456-row-image-wont-display/ Share on other sites More sharing options...
ikmyer Posted March 16, 2008 Share Posted March 16, 2008 try $row['image'] assuming image is the name of the field in the DB... Link to comment https://forums.phpfreaks.com/topic/96456-row-image-wont-display/#findComment-493662 Share on other sites More sharing options...
dazz_club Posted March 16, 2008 Author Share Posted March 16, 2008 just done it, it was $row[image], no ' surrounding the word image. Thank you for your help. kind regards Dazzclub Link to comment https://forums.phpfreaks.com/topic/96456-row-image-wont-display/#findComment-493666 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.