954,561 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

PHP Problem, not sure what's causing.

I have a php report page I'm working on that's giving me some problems. It's designed to be used on multiple systems; as far as I know, all of these systems are identical. On the system I did development on, the page displays information as needed. On the others, I don't get to see it unless I knock out a specific block of code. Thing is, the code in question doesn't relate to what I'm doing.

This page is designed to be used for two reports. They draw the same information, and they have almost the same format. Therefore, I figured that, since the two are also supposed to always be displayed together, it'd be a good idea to simply modify the original code so it had segments for report A and segments for report B.

Which path is followed is determined by a specific flag variable, $_90Plus. In report A, $_90Plus is supposed to be false; in report B, $_90Plus is supposed to be true.

As I mentioned above, when I'm running the program, I get what seems to me to be a rather strange error. Report B (remember, that's $_90Plus == true) doesn't run to completion if this segment of code, which has meaning only for report A, isn't commented out.

if ($_90Plus == 'False')
            {
              $statnSQL = "****";
              $statnResult = @mysql_query($statnSQL) or die("could not complete station query");
              $row2 = @mysql_fetch_array($statnResult);
              $statnCnt = $row2["count(Stn_Seq)"];

              $statnSQL = "****";
              $statnResult = @mysql_query($statnSQL) or die("could not complete station query");
              $row2 = @mysql_fetch_array($statnResult);
              $statnCntChk = $row2["count(Stn_Seq)"];
            }



(SQL statements removed as it's business information and I don't want to risk it getting scattered around online.)

Other sections of the code that rely on the 'if ($_90Plus == 'False')' code being set seem to work correctly, only this one does not. And again, if I completely comment it out, I get my report B data correctly, but not my report A data, which does require this code.

Anybody have any ideas what might be causing this kind of problem?

EnderX
Posting Shark
999 posts since Aug 2006
Reputation Points: 483
Solved Threads: 1
 

Please ignore, problem solved.

EnderX
Posting Shark
999 posts since Aug 2006
Reputation Points: 483
Solved Threads: 1
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You