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
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>";
  
?>

Link to comment
Share on other sites

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';

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.