I have this code but I dont know how to fix this...
When I run this in my site and click this link
<a href="#add"> <img src="image/addtocart.png" width="50%" style="margin-left: 170px;"></a>
the data from $row[product_name]
will be not store in this class
<!---- POPUP #CHOOSE SIZE ----->
<a href="#x" class="overlay" id="add"></a>
<div class="box">
<h2><span style="color:blue;font-weight:bold">Choose Size</span></h2>
<?php echo "<h5>$row[product_name]</h5></br>"; ?>
<?php
$sql1="SELECT product_size, product_price FROM products where product_name='$row[product_name]'";
foreach ($conn->query($sql1) as $row1){
echo " $row1[product_price]";
echo "<p><button name='submit' type='submit' class='a_demo_five' value='$row1[product_size]'>$row1[product_size] P$row1[product_price].00</button></p>";
}
?>
This is my original code:
<?php
include 'core/admin/admin_db.php';
$sql="SELECT DISTINCT product_name, product_description, product_image FROM products WHERE product_category = 'Chicken' GROUP BY product_name";
echo"<div class='scroll2'>";
foreach($conn->query($sql) as $row){
echo "<li>";
echo "<div class='grow2 pic'><img src='$row[product_image]'></div>";
echo "<h5>$row[product_name]</h5></br>";
?>
<a href="#add"> <img src="image/addtocart.png" width="50%" style="margin-left: 170px;"></a>
<!---- POPUP #CHOOSE SIZE ----->
<a href="#x" class="overlay" id="add"></a>
<div class="box">
<h2><span style="color:blue;font-weight:bold">Choose Size</span></h2>
<?php echo "<h5>$row[product_name]</h5></br>"; ?>
<?php
$sql1="SELECT product_size, product_price FROM products where product_name='$row[product_name]'";
foreach ($conn->query($sql1) as $row1){
echo " $row1[product_price]";
echo "<p><button name='submit' type='submit' class='a_demo_five' value='$row1[product_size]'>$row1[product_size] P$row1[product_price].00</button></p>";
}
?>
Thanks In Advance!