bu kodun tasarımsal kısmının da burada olduğunu farzedelim
if ($row['pd_image3']) {
echo "<img src="$row['pd_image3'] = WEB_ROOT . 'images/product/' . $row['pd_image3'];" />";
} else {
//boş bıraktığında tasarım içinde resim falan göstermez ama işte işin tasarımsal kısmı da lazım bunun gibi bir örneğe detaylı yardım verebilmek için
}
yardımınız için çok teşekkürler ama ne yazık ki bu kod istediğim sonucu vermedi. kodların tamamını atıyorum :
<?php
require_once 'config.php';
/*********************************************************
* PRODUCT FUNCTIONS
**********************************************************/
/*
Get detail information of a product
*/
function getProductDetail($pdId)
{
$_SESSION['shoppingReturnUrl'] = $_SERVER['REQUEST_URI'];
// get the product information from database
$sql = "SELECT pd_name, pd_description, pd_price, pd_image, pd_image2, pd_image3, pd_image4, pd_qty
FROM tbl_product
WHERE pd_id = $pdId";
$result = dbQuery($sql);
$row = dbFetchAssoc($result);
extract($row);
$row['pd_description'] = nl2br($row['pd_description']);
if ($row['pd_image']) {
$row['pd_image'] = WEB_ROOT . 'images/product/' . $row['pd_image'];
} else {
$row['pd_image'] = WEB_ROOT . 'images/no-image-large1.png';
}
if ($row['pd_image2']) {
$row['pd_image2'] = WEB_ROOT . 'images/product/' . $row['pd_image2'];
} else {
$row['pd_image2'] = WEB_ROOT . 'images/no-image-large1.png';
}
if ($row['pd_image3']) {
$row['pd_image3'] = WEB_ROOT . 'images/product/' . $row['pd_image3'];
} else {
$row['pd_image3'] = WEB_ROOT . 'images/no-image-large1.png';
}
if ($row['pd_image4']) {
$row['pd_image4'] = WEB_ROOT . 'images/product/' . $row['pd_image4'];
} else {
$row['pd_image4'] = WEB_ROOT . 'images/no-image-large1.png';
}
return $row;
}
?>