Welcome Guest, Not a member yet? Register   Sign In
Some **OK** code in my controller beaks CodeIgniter: output goes totally blank.
#21

[eluser]Fabdrol[/eluser]
[quote author="BrianDHall" date="1261092611"]Even if you don't use it much, it's nice to have an IDE with syntax verification like netbeans to use in cases like this. Took me just about 30 seconds to pop it open, paste in your code, and have it reveal the problem.

Lines 34-37:

Code:
$out = array(
                'status': 'OK',
                'results': array()
            );

The annoyance of using multiple languages at once - you defined your array in javascript style Smile

A simple correction removes the syntax errors, so hopefully this will solve the issue:

Code:
$out = array(
                'status' => 'OK',
                'results' => array()
            );

One downside to CI is this blank-screen problem, where in pure PHP it would always output _something_.

My solution is using step-through debugging - you just advance one line at a time until it suddenly halts execution, and you know that last line was where something broke php.[/quote]

Thank you - very much! I've been working so much in JS lately that I'm making these errors more and more... I'm surprised that Coda didn't pick it up, I'll take a look around if there's some plugin to add that functionality ;-)

Thanks mate!




Theme © iAndrew 2016 - Forum software by © MyBB