954,568 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

mysql image Link

I want to add an image to my php script:

<?php

$sql = "select * from Prod_listing"; $result = mysql_query ($sql);

while ($row = mysql_fetch_array($result)) { $field1= $row["Product_Name"]; $field2= $row["Product_Id"]; $field3= $row["Product_Description"]; $field4= $row["Product_picurl"];

echo "

$field1

"; // Header Tag, bold.tag echo "$field2
"; echo "$field3
"; echo "$field4

----------------

"; //echo } ?>

The picture link is stored in $field4

thanks in advance

duttydea
Newbie Poster
21 posts since Jan 2008
Reputation Points: 10
Solved Threads: 0
 

Firstly, you don't need to put a strong tag inside h1 since it already bolds anything in h1.
Secondly, an image link is created with <img src="image link here" alt="text to display if it doesn't show up" />

ShawnCplus
Code Monkey
Team Colleague
1,583 posts since Apr 2005
Reputation Points: 526
Solved Threads: 268
 

how do i use the data stored in $field4.

duttydea
Newbie Poster
21 posts since Jan 2008
Reputation Points: 10
Solved Threads: 0
 

Since $field4 is storing the path of the image, as Shawncplus has already said, use tag. ie., image

nav33n
Purple hazed!
Moderator
4,465 posts since Nov 2007
Reputation Points: 524
Solved Threads: 356
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You