Skip to content
Advertisement

For loop is going again and again for the same values

I am not sure what is going wrong. But the system is printing the same values again and again, where it should echo the value only once where it is matching student_id in the delivery table. The full code I have edited as requested. This is not executing the query but able display the Table headings.

The code is :

JavaScript

attached is screenshot of table Deliveries is there Deliveries Picture Download

Advertisement

Answer

Here is your code updated to fix the performance issues mentioned by Arnold Daniels.

JavaScript

It appears to be working fine as far as I could test it. Is there anything missing from the snippet you posted that could help reproduce your issue?

Edit:

So the complete code would be:

JavaScript

I would need to see the contents of the included file “fancy.php” to be sure. There was an extra endforeach statement, but I’m guessing that it came from somewhere beyond the scope of the snippet you updated. I would need to see the whole content of the file and the content of the included script in order to determine the true nature of the error.

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement