Skip to content
Advertisement

My nested while loop is giving me only a single row from database whereas I have many records in database

I want to create time table. Need to get subject names from database in check boxes and teachers name from database in select dropdown. I am using following code but it give me only single row. I don’t know where I am doing mistake.

JavaScript

Advertisement

Answer

The problem you have is that you use the same variable name $query for both queries, and so the second one overwrites the first one. Try using $empQuery or something else for the second one.. (same for $row -> $empRow)

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