I am using this sample to do a mouseover popup: https://www.phpzag.com/demo/load-dynamic-content-in-bootstrap-popover-with-ajax-php-mysql/ . That demo uses static thumbnails from a local directory on server like so: img src="images/p_image" class="img-responsive img-thumbnail"
I need to pull thumbnails from my database called gck and a table called thumbnail. I can get popup populated but it puts all the thumbnails in one popup (every thumbnail shows up in the first popup).
I believe I can get it working with the following:
$sql1 = "SELECT * FROM gck";
$resultset = mysqli_query($conn, $sql) or die("database error:". mysqli_error($conn));
while( $emp = mysqli_fetch_assoc($resultset) ) {
?>
<tr>
<td>0000<?php echo $emp["id"]; ?></td>
<td><a href="\gck\includes\display.php?id=<?=$emp['id']?>" target = "new" class="hover" id="<?php echo $emp["id"]; ?>"><?php echo $emp["brand"];?></a></td>
<div id="popover_html" style="display:none;">
<?php
include_once 'includes/database.php';
$sql2 = "SELECT row,thumbnail FROM gck where id= $emp["id"]";
$result = mysqli_query($conn,$sql2);
$i=1;
while($row = mysqli_fetch_array($result)) {
<img src="data:image/jpg;charset=utf8;base64, <?php echo base64_encode($row["thumbnail"])?>
</tr>
I need $sql2 to be something like: "SELECT row,thumbnail FROM gck where id = $emp["id"]" ($emp is from $sql1 statement)
How do I access $emp["id"] from sql1 statement into sql2 statement? here is pic of what I am getting: https://photos.app.goo.gl/8TWz2G42q7WYmEnM9