you still need to use html to display an image on the screen, even if
you got it form the database.
change:
<?php echo $itemNo["prodImageSmallPath"]; ?>
to
<?php echo "<img src=" . $itemNo["prodImageSmallPath"] ." />"; ?>
And before you get into this too far, I'd HIGHLY suggest you look into CSS.
All those in-line center and font tag non-sense is not only depreciated, but
makes the entire code a mess.
More so, querying the database 5 different times for 1 record is a huge no-no.
You will add crazy server load by doing that.
Select everything you need (no, not *, select the field names) and put it into
an array with one query.
Crestland Morgans wrote:
> Hello,
>
> I am setting up an ecommerce site from scratch using php and mysql
> and I am a beginner with php and mysql. I set up my database. I have
> come up with the coding for accessing the product, description, price
> and a place for the quanity input. What I need to add is a picture of
> the product. Right now my coding will list the path of the picture
> but not show the picture of the product. What am I missing. I know
> that the coding is working some what because when I test out
> different pages with products the text changes for the image.
> This is the text that comes up instead of where I should see a
> picture:
> images/catalog/page4/ww-731.gif
>
> Any suggestions would be most appreciated.
> Thanks!
> ladycard
>
>
> Here is my coding so far after I have connected my database.
>
> $mlproducts = $HTTP_GET_VARS["ProdID"];
>
> $query_product = "select * from mlproducts where
> mlproducts.prodID = '$mlproducts'";
> $query_prodName= "select from mlproducts where
> mlproducts.prodName = '$mlproducts'";
> $query_prodPrice = "select from mlproducts where
> mlproducts.prodPrice = '$mlproducts'";
> $query_prodPrice = "select from mlproducts where
> mlproducts.prodImageSmallPath = 'prodImageSmallPath'";
> ?>
> <table width="520" border="0" align="center">
> <caption>
> <font face="Arial" size="4"><b>Mann Lake Ltd. -
> Order Form</b></font>
> </caption>
> <tr>
> <td><center>
> <?php
> if(!empty
> ($mlproducts))
> {
>
> $fetch_query = mysql_query($query_product, $connection);
>
> $itemNo = @mysql_fetch_array($fetch_query);
>
>
> ?>
> <?php echo $itemNo["prodImageSmallPath"]; ?>
>
> </center>
> </td>
> </tr>
> <tr>
> <td>
> <table width="520" border="1" cellspacing="0"
> cellpadding="3">
> <tr bordercolor="#C0C0C0" bgcolor="#126300">
> <td align="center"><p
> align="center"><font face="Arial" size="2" color="#FFFFFF"><b>Item
> No.</b></font></p></td>
> <center>
> <td align="center" ><font
> face="Arial" size="2" color="#FFFFFF"><b>Description</b></font></td>
> </center>
> <td align="center" height="16"
>
>> <font face="Arial" size="2" color="#FFFFFF"><b>Price</b></font> </td>
>>
> <td align="center" height="16" ><p
> align="center"><font face="Arial" size="2"
> color="#FFFFFF"><b>Quantity to Order</b></font></p></td>
> </tr>
> <tr>
> <td width="70">
> <center>
> <strong><font
> size="2" face="Arial, Helvetica, sans-serif">
> <?php
> echo
> $itemNo["prodID"];
> ?>
>
> </font></strong>
> </center>
> </td>
> <td width="250">
> <center>
> <font size="2"
> face="Arial, Helvetica, sans-serif">
> <?php
>
> echo $itemNo["prodName"];
> ?>
>
> </font>
> </center>
> </td>
> <td width="90">
> <center>
> <font size="2"
> face="Arial, Helvetica, sans-serif">
> <?php
> echo $itemNo
> ["prodPrice"];
> ?>
>
> </font>
> </center>
> </td>
> <td width="70">
> <center>
> <font size="2"
> face="Arial, Helvetica, sans-serif">
> <input type="text"
> size="3" name="num_quantity" value="1">
> </font>
> </center>
> </td>
> <?php }else{
> echo "Variable not set"; } ?>
> </tr>
> </table>
>
>
>
>
>
> Community email addresses:
> Post message: [email protected]
> Subscribe: [EMAIL PROTECTED]
> Unsubscribe: [EMAIL PROTECTED]
> List owner: [EMAIL PROTECTED]
>
> Shortcut URL to this page:
> http://groups.yahoo.com/group/php-list
> Yahoo! Groups Links
>
>
>
>
>
>
Community email addresses:
Post message: [email protected]
Subscribe: [EMAIL PROTECTED]
Unsubscribe: [EMAIL PROTECTED]
List owner: [EMAIL PROTECTED]
Shortcut URL to this page:
http://groups.yahoo.com/group/php-list
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/php-list/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/php-list/join
(Yahoo! ID required)
<*> To change settings via email:
mailto:[EMAIL PROTECTED]
mailto:[EMAIL PROTECTED]
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/