What's broken and where?

What's broken and where?

Posted by: quanin
Posted on: 2007-12-03 10:58:00

I'm trying to debug a piece of software from Anodyne Productions, called 'Sim Management System' (SMS), to try and figure out why it is it won't let me make any significant changes to the actual database settings. I'm using php5, and MYSQL. The debug code I'm using should print me the exact contents of the variables I'm trying to submit to the database to make sure they're at least getting from my browser to the server, but it's instead throwing back a parse error.
[code]
                if( !empty( $check->query ) ) {                                                                                                            $check->message( "department", $action );                                                                 
                        $check->display();                                                                                              echo "<pre>";                                                                                                                      print_r( $_POST );                                                                                                                 echo "</pre>";                    
     echo $check->query;                                                                       
                }                                                                                                                   [/code]

So why is this code broken? I have no idea, and I've had like 3 other people look at it already.

Yes, I have an opinion.

Get a minimum 50% off with the "haveadreamyday" promo code, and... have a dreamy day. Original, no?

Re: What's broken and where?

Posted by: scjessey
Posted on: 2007-12-03 12:17:00

I cannot see anything that might producing a parse error. Can you tell us the actual error? For readability, by the way, I am reproducing the code below in a different format:

if(!empty($check->query)) {
$check->message("department", $action);
$check->display();
echo "<pre>";
print_r($_POST);
echo "</pre>";
echo $check->query;
}

-- si-blog --

Re: What's broken and where?

Posted by: quanin
Posted on: 2007-12-03 13:38:00

In reply to:

Parse error: syntax error, unexpected T_STRING in /home/.capone/quanin/var/www/sms/admin/manage/departments.php on line 95



Line 95 of this file contains only:
     echo "<pre>";

One would think *that* wouldn't generate a parse error, but apparently, it is.

Yes, I have an opinion.

Get a minimum 50% off with the "haveadreamyday" promo code, and... have a dreamy day. Original, no?

Re: What's broken and where?

Posted by: scjessey
Posted on: 2007-12-03 16:34:00

It is almost certainly a problem earlier in the script than line 95. The fact that line 95 is just a simple echo is an indication that there is a missing double-quote somewhere.

-- si-blog --

Re: What's broken and where?

Posted by: quanin
Posted on: 2007-12-03 17:53:00

Ordinarily I'd agree with you. But if I remove everything from that echo statement to the closing brace, it does what is expected. All this should be doing is just printing to my screen what it's already supposed to be submitting to the database. So if it fails, wouldn't it fail anyway?

Yes, I have an opinion.

Get a minimum 50% off with the "haveadreamyday" promo code, and... have a dreamy day. Original, no?

Re: What's broken and where?

Posted by: scjessey
Posted on: 2007-12-03 18:08:00

Try changing echo() to print() to see if that makes a difference.

-- si-blog --

Re: What's broken and where?

Posted by: quanin
Posted on: 2007-12-03 18:44:00

Same error, same line.

Yes, I have an opinion.

Get a minimum 50% off with the "haveadreamyday" promo code, and... have a dreamy day. Original, no?

Re: What's broken and where?

Posted by: netdcon
Posted on: 2007-12-06 14:52:00

In reply to:

But if I remove everything from that echo statement to the closing brace, it does what is expected.


Tough to determine without seeing the entire source file.

I rely on my IDE to ferret-out this kinda glitch; if you're at all interested ya can d/l a trial at http://www.nusphere.com/download.php.ide.htm

Tags: parse errordebugdatabase settingsphp5variablesparse errordebugdatabase settingsphp5variables