Display images on PHP website page

Hi I’m new to PHP, at the moment I have to create an ecommerce website and I’m having trouble displaying the images on the products page I have a table called products and in the table is a column called img which has the direct path to the image for example C:/xampp/htdocs/Online_Shopping/Online_Shopping/itempics/1.jpg is one variables in the img colum , but whenever I run the page no images are displayed however the product price and name are displayed here’s my code

[php]


Apple Desktops

<?php

include(“config.php”);
$catg=$_REQUEST[‘catg’];
$subcatg=$_REQUEST[‘subcatg’];

$sel=mysql_query(“select * from products where catg=’$catg’ and subcatg=’$subcatg’”);
echo"

";
$n=1;
while($arr=mysql_fetch_array($sel))
{
$i=$arr[‘img’];
if($n%4==0)
{
echo “”;
}
echo " "; $n++;

}
echo "


".$arr[’’].
"
Price:R “.$arr[‘product_price’].

Name:”.$arr[‘product_name’].”




";
?>

[/php]

Forget about that. You are using obsolete insecure dangerous code that has been completely removed from Php. You need to use PDO with prepared statements. https://phpdelusions.net/pdo

Sponsor our Newsletter | Privacy Policy | Terms of Service