What's broken and where?

software development

#1

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.

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

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?


#2

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
Max discount on any plan with promocode SCJESSEYTOTAL


#3

Line 95 of this file contains only:
echo “

”;

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?


#4

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
Max discount on any plan with promocode SCJESSEYTOTAL


#5

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?


#6

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

si-blog
Max discount on any plan with promocode SCJESSEYTOTAL


#7

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?


#8

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