Jump to content

[SOLVED] displaying image from image path


mallen

Recommended Posts

  Trying to display this simple query. Everything works but i can't get the image path correct. Its just displaying the image name.

 

while ($row = mysql_fetch_array ($r)) { print "<p>{$row['title']} <br />
   {$row['address']} <br />
   {$row['description']} <br />
   {$row['price']} <br />
   <img src= "./uploads/images".{$row[['images']}"/>  <br />
   {$row['contact']} <br />
   {$row['phone']} </p>";

Link to comment
https://forums.phpfreaks.com/topic/76132-solved-displaying-image-from-image-path/
Share on other sites

It thought you were trying to concat the string when you used double quotes. You also had two brackets for $row['images'], you had it like $row[['images']

 

<?php

while ($row = mysql_fetch_array ($r)) { 
   print "<p>{$row['title']} <br />
   {$row['address']} <br />
   {$row['description']} <br />
   {$row['price']} <br />
   <img src='/uploads/images{$row['images']}'>  <br />
   {$row['contact']} <br />
   {$row['phone']} </p>";
  
?>

Thanks for the help. I didn't see that. Now I have a new issue. I want to only return results if one of the fields is not null. Such as is if there is a price, an image, description then display the results. I just can't figure it out.

 

$query = 'SELECT * FROM phpbb_users WHERE price or image or description IS NOT NULL';

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.