Re: not gettingg desired results... is my programming logic run amuck...

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tuesday 28 December 2004 22:29, GH wrote:

Please do not top post.

> The isAttendanceReport() fails... so in the displayMenu() function I get
>
> Print Attendance Sheet
> No Attendance Report Available1

OK, so why does isAttendanceReport() return 0?

When debugging it's always a good idea to plugin absolute values where 
possible, ie instead of using isAttendanceReport($SID), use 
isAttendanceReport(1).

Isolate the problem, just run isAttendanceReport() on its own and plugin 
various values to see what comes back.

> > Note that it is good practice to use { } around your statement(s).
>
> I am under the opression that it is only for when you have
> multistatement groups and not just a one statement after a condition?
> Please correct me if I am wrong.

You're not wrong, like I said it's _good practice_. Say you revise your code 
to add more statements, it is all too easy to forget to put in the braces as 
well thus resulting in faulty logic in your code and you pulling your hair 
out trying to figure what the problem is. PHP's flexibility also means that 
there is more than one way to shoot yourself in the foot (TIMTOWTSYITF (TM)).

BTW PHP is not an oppressive language at all :)

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
------------------------------------------
/*
The wind doth taste so bitter sweet,
 Like Jaspar wine and sugar,
It must have blown through someone's feet,
 Like those of Caspar Weinberger.
  -- P. Opus
*/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux