0

Hey guys, so I have been trying to get images to appear with an SQL query using PHP.

My table has a column called picture, it is datatype nvarchar50. I have a folder in my project called images and in there an image called 4.png. So in the field of my picture column, I have the string, images/4.png.
In my query, I return data from a query and am trying to make an image show with this data, here is my query output code:

while( $row = sqlsrv_fetch_array ( $result, SQLSRV_FETCH_ASSOC))
														{
															echo 'ID number: '.$row['productID'];
															echo '<br/> category: '.$row['category'];
															echo '<br/> product name: '.$row['productName'];
															echo '<br/> Range: '.$row['range'];
															echo '<br/> description: '.$row['description'];
															echo '<br/> size: '.$row['size'];
															echo '<br/> colour: '.$row['colour'];
															echo '<br/> availible: '.$row['available'];
															echo '<br/> price: '.$row['price'];
															echo '<br/> picture: <img  src="'.['picture'].'">;
														
														}

This works, but the last line doesn't, how can I load an image in my query from my project folder, I do not want to store images in the database, just strings linking to the images, can anyone please help me out?

Many thanks!

2
Contributors
3
Replies
7
Views
5 Years
Discussion Span
Last Post by diafol
1
<img  src="'.$row['picture'].'" />;
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.