screenshot: https://i.sstatic.net/mX29j.png
im currently making an invoice receipt. the numbers you see on the image, 4600 and 33, are the retrieved values from the checklist from the first page. As you can see, it only lists ONE charge where as it should be two.
this is the part of the code:
$procedures = $_SESSION['receipt'];
foreach($procedures as $key=>$procedureno)
{
$query = "select * from `charges` where `procedure_no` = $procedureno";
echo $procedureno;
$result2=mysql_query($query,$dbh1);
if(mysql_num_rows($result2) > 0 ){
while($row = mysql_fetch_array($result2)){
echo '
<tr>
<td>'.$row[1].'</td>
<td>'.$row[2].'</td>';
echo '</tr>';
}
}
}
I want this query $query = "select * from charges where procedure_no = $procedureno"; to be executed several times depending on how many the $procedureno is.