I have a css modal window. which i want to display the sql result. When i click on a link. after the link is clicked, it gets the id from <a href="index.php?idi='.$id.'">
and selects the data from database and show in the popup, this where i have place the code to view on popup index.php
. but this is not working, I need to know what is missing or what has to be added, thank you
if (isset($_GET['idi'])) {
$pop_id = $_GET['idi'];
$popList="";
$sql = mysql_query("SELECT * FROM products WHERE id='$pop_id' LIMIT 1");
if($sql === false) {
var_dump(mysql_error());
}
else {
print_r(mysql_num_rows($sql));
}
$popCount = mysql_num_rows($sql); // count the output amount
if ($popCount == 1) {
while($row = mysql_fetch_array($sql)){
$exp = $row["expiry"];
$com = $row["comments"];
$term = $row["terms"];
$qid = $row["id"];
$pname = $row["product_name"];
$rs = $row["price"];
$detail = $row ["details"];
$popList .= '<a href="#x" class="overlay" id="tc_form"></a>
<div class="popup">
<h2>Product Offer</h2>
<p></p>
<div>
<label for="pass">Price <?php echo $rs; ?></label>
</div>
<div>
<label for="firstname">Expiry Date</label>
</div>
<div>
<label for="lastname">Details</label>
</div>
<div>
<label for="lastname">Conditions</label>
</div>
<div>
<label for="lastname">Terms & Conditions</label>
</div>
</div>';
}
} else {
echo "That item does not exist.";
exit();
}