I have some results which i can echo fine in a blank document but when i try to echo it within the rest of my results it duplicates. I have some results that have a code, a name, a hazard and a risk to. It's the rate results that i can't get to work correctly, i'm posting this rate data to it from a previous page for these results and the rest of the results are coming from a database.
How many results there are for the hazards is how many times the data duplicates, PLEASE HELP!
works fine here:
foreach($_POST['rate'] as $id => $value)
{
echo "".$value."";
}
If two drop down boxes are changed then 2 seperate results appear in the page above.
Now here's the problem i think it's looping too many times:
while ($inquiryrow = mysql_fetch_array($results)) {
foreach($_POST['rate'] as $id => $value)
{
$pdf->Cell (20, 8, $inquiryrow["hcode"], 1);
$pdf->Cell (130, 8, $inquiryrow["hazard"], 1);
$pdf->Cell (20, 8, "$value", 1);
}}
The current results from the code above look like so:
c1, trips and falls, HIGH, employee
c1, trips and falls, LOW, employee
c3, cuts from glass, HIGH, employee
c3, cuts from glass, LOW, employee
And I want it to be (as i have posted HIGH(once) and LOW(once) from the previoucs page:
c1, trips and falls, HIGH, employee
c3, cuts from glass, LOW, employee