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>"; Quote Link to comment 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>"; ?> Quote Link to comment 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'; Quote Link to comment 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 != ""'; Quote Link to comment Share on other sites More sharing options...
mallen Posted November 7, 2007 Author Share Posted November 7, 2007 Thanks that worked. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.