Issue with MySQL data and Jquery popup box
Posted: 27 May 2010, 13:35
Hey Guys
I'm trying to call a set of images and descriptions from a MySQL database. Everything works great until the user clicks a button for additional info which calls a jquery popup which is suppose to display the description. It does what its suppose to, but only shows the info for the 1st image on every image.
Could it be an issue between the php and javascript?
Thanks
Javascript that calls popup:
Php that shows image and popup info:
I'm trying to call a set of images and descriptions from a MySQL database. Everything works great until the user clicks a button for additional info which calls a jquery popup which is suppose to display the description. It does what its suppose to, but only shows the info for the 1st image on every image.
Could it be an issue between the php and javascript?
Thanks
Javascript that calls popup:
Code: Select all
<script type="text/javascript">
$(document).ready(function() {
$(".popup").colorbox({width:"50%", inline:true, href:"#inline"});
});
</script>
Code: Select all
<?php
mysql_select_db($database_conn_macph, $conn_macph);
$range = $_GET['range'];
$intCount;
$result = mysql_query("SELECT * FROM product_info WHERE range_name = '$range'");
while($row = mysql_fetch_array($result)) {
echo "<div class='panel'>";
echo "<table width='100%'>";
echo "<tr>";
echo "<td>";
echo "<img src='".$row['image']."' border='0px' />";
$intCount = $row['description'];
echo "<a class='popup'><img src='images/buttons/info.png' width='38px' style='float:right; padding-right:22px;' /></a>";
echo "<div style='display:none'>";
echo "<div id='inline' style='padding:1px; background:#fff; text-align:left;'><p>".$row['description']."</p></div>";
echo "</div>";
echo "</td>";
echo "</tr>";
echo "</table>";
echo "</div>";
}
?>