kumarsivarajan / rmh-roomreservation-maker

Automatically exported from code.google.com/p/rmh-roomreservation-maker
0 stars 0 forks source link

report error message needs to be more informative #121

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1.log in as mary789
2.Choose reports
3.Select an end date in the future

What is the expected output? What do you see instead?
For a report end date in the future, probably the right thing to do is to 
display an error message, since reports are supposed to be about completed 
stays. The error message that is displayed, though, gives no hint as to the 
problem. See the screenshot

Original issue reported on code.google.com by bkmackellar on 2 Dec 2012 at 8:28

Attachments:

GoogleCodeExporter commented 8 years ago
I think one of the contributors to this problem is incorrect error handling in 
dbReservation.php.
Here is an example of error handling code in this script
$result = mysql_query($query);
          if(mysql_num_rows($result)< 1)
          {
           echo mysql_error()." >>>Unable to retrieve from Room Reservation Activity table. <br>";
           mysql_close();
           return false;
          }  
This basically says if we retrieve no rows, to treat it as a database error. 
But that isn't an error - it is often an expected result. If no rows are 
retrieved, it simply means there are no rows for those dates. I think the 
database function should simply return an empty reservation list, and let the 
calling script handle the case of no rows being retrieved in whatever way makes 
sense. 
However, right now this is not a high priority fix. It is ugly but we can live 
with it. The report logic should be fixed to detect the date being in the 
future.

Original comment by bkmackellar on 2 Dec 2012 at 8:43