Getting an image to display
Posted: Sat May 18, 2002 11:38 pm
Alright, I have an image url stored in a database for an ecommerce site. when someone goes to review an item, the image of the item is shown. but i can't get the image to show. so without further ado, here's my code:
function review_item()
{
global $review_item_id;
global $PHP_SELF;
global $browse_font_color;
$result=mysql_query("SELECT * FROM items WHERE item_id=$review_item_id");
WHILE ($row=mysql_fetch_array($result))
{
$item_name=$row["item_name"];
$item_description=$row["item_description"];
$item_price=$row["item_price"];
$image_id=$row["image_id"];
If ($image_id!='0'):
$result = mysql_query("SELECT * FROM `images` WHERE `image_id` = $image_id LIMIT 1;");
$row = mysql_fetch_row($result);
return($row[1]);
$blarg = getUrl(1);
Print "<img src=$blarg><BR>";
Endif;
Print "$item_name<BR>\n$item_description<BR>\n<BR>\n\$$item_price<BR><BR>";
Print "<a href='$PHP_SELF?buy_item_id=$review_item_id'>\n";
Print "<FONT FACE='Helvetica,Verdana,Arial' COLOR='#$browse_font_color'>";
Print "Purchase this Item";
Print "</FONT>";
Print "</a>\n";
}
}
with that code, nothing gets shown, image or the item stuff. can anyone suggest what i need to do? thanx.
function review_item()
{
global $review_item_id;
global $PHP_SELF;
global $browse_font_color;
$result=mysql_query("SELECT * FROM items WHERE item_id=$review_item_id");
WHILE ($row=mysql_fetch_array($result))
{
$item_name=$row["item_name"];
$item_description=$row["item_description"];
$item_price=$row["item_price"];
$image_id=$row["image_id"];
If ($image_id!='0'):
$result = mysql_query("SELECT * FROM `images` WHERE `image_id` = $image_id LIMIT 1;");
$row = mysql_fetch_row($result);
return($row[1]);
$blarg = getUrl(1);
Print "<img src=$blarg><BR>";
Endif;
Print "$item_name<BR>\n$item_description<BR>\n<BR>\n\$$item_price<BR><BR>";
Print "<a href='$PHP_SELF?buy_item_id=$review_item_id'>\n";
Print "<FONT FACE='Helvetica,Verdana,Arial' COLOR='#$browse_font_color'>";
Print "Purchase this Item";
Print "</FONT>";
Print "</a>\n";
}
}
with that code, nothing gets shown, image or the item stuff. can anyone suggest what i need to do? thanx.