JDrapes / WEDA-MVC

WEDA MVC
0 stars 0 forks source link

Code issue - Result Sets - Reading from multiple rows in database #7

Closed presssyy closed 5 years ago

presssyy commented 5 years ago

Hi Gents, there is currently an issue with the readability to the database as it only reads the top row, spotted by Jordan. I've tried to solve this error but I'm having no luck with solving this issue. This code is within the LoginController java file. Line 46 is the code that should enable the result set to loop through the entire database but this isnt the case as testing results in a fail. If anyone can have a look at this to try spot the mistake I'm missing that would be appreciated.

GraingerBoii commented 5 years ago

Hi Alex,

I had a look at the code and noticed that the issue is that while checking the entries in the database, your else statement resets the page, and as a result exits the loop if the first entry doesn't match. By moving the event of the else statement outside the loop, it checks all entries, if an entry is correct it will move to the login page, if non are correct it will exit the loop and run the code for incorrect details.

JDrapes commented 5 years ago

Solved - closing comment