So I've been breaking my brain over this one and I still can't figure it out. I have only basic knowledge of PHP and Modal Boxes and Javascript. So here's my concern...
I have PHP getting MySQL data from my database and placing this data in a table on my website [Bear in mind, this is a website for a fastfood restaurant]. I have a while loop that runs and adds each record in a table, and I add an ORDER button for each item. Each button is intended to open a modal box with the relevant item's information (so that I can add it to the shopping cart: i do have the shopping cart in order though).
THE PROBLEM:
Only the [ORDER] Button of the first item opens a modal box. The other buttons DON'T OPEN UP MODAL BOXES.
<?php
$con = mysqli_connect("localhost","root","root","mcd");
if(!$con){
die("Can not connect".mysql_error());
}
$query = mysqli_query($con, "select * from pizza");
echo "<table border=1 align='center' width=50%>
<tr>
<th>Name</th>
<th>Medium</th>
<th>Large</th>
</tr>";
while ($record = mysqli_fetch_array($query)) {
echo "<tr>";
echo "<td align='right'>".$record['pizzaName']."</td>";
echo "<td align='right'> R".$record['PriceMedium']."</td>";
echo "<td align='right'> R".$record['PriceLarge']."</td>";
echo "<td align='right'> <input id='myBtn' type='button' value='ORDER'/>";
echo "</tr>";
}
echo "</table>";
?>