mallen Posted November 6, 2007 Share Posted November 6, 2007 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 More sharing options...
pocobueno1388 Posted November 6, 2007 Share Posted November 6, 2007 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 https://forums.phpfreaks.com/topic/76132-solved-displaying-image-from-image-path/#findComment-385318 Share on other sites More sharing options...
mallen Posted November 6, 2007 Author Share Posted November 6, 2007 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 https://forums.phpfreaks.com/topic/76132-solved-displaying-image-from-image-path/#findComment-385389 Share on other sites More sharing options...
pocobueno1388 Posted November 6, 2007 Share Posted November 6, 2007 Try $query = 'SELECT * FROM phpbb_users WHERE price != "" OR image != "" OR description != ""'; Link to comment https://forums.phpfreaks.com/topic/76132-solved-displaying-image-from-image-path/#findComment-385393 Share on other sites More sharing options...
mallen Posted November 7, 2007 Author Share Posted November 7, 2007 Thanks that worked. Link to comment https://forums.phpfreaks.com/topic/76132-solved-displaying-image-from-image-path/#findComment-387205 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.