Mutley Posted January 6, 2007 Share Posted January 6, 2007 I have several IF statements but get an unexpected "}" error. The code is working fine as I've tested the IF statements seperatly. It is like the last ELSE statement for the first IF statement closes too early.Is this a common problem with the structure of the statements? Quote Link to comment https://forums.phpfreaks.com/topic/33131-solved-php-statements-close-too-early/ Share on other sites More sharing options...
wattsup88 Posted January 6, 2007 Share Posted January 6, 2007 I have actually had some problems with if statements lately also... Unfortunately I can't help you when it comes down to fixing them... I havent even been able to fix my own... I would enjoy the answer to this question also... Quote Link to comment https://forums.phpfreaks.com/topic/33131-solved-php-statements-close-too-early/#findComment-154352 Share on other sites More sharing options...
genericnumber1 Posted January 6, 2007 Share Posted January 6, 2007 I've never had any problems, it might just be the other code interfering. Maybe show us your script? Quote Link to comment https://forums.phpfreaks.com/topic/33131-solved-php-statements-close-too-early/#findComment-154363 Share on other sites More sharing options...
Jessica Posted January 6, 2007 Share Posted January 6, 2007 Post the code Quote Link to comment https://forums.phpfreaks.com/topic/33131-solved-php-statements-close-too-early/#findComment-154371 Share on other sites More sharing options...
Asheeown Posted January 6, 2007 Share Posted January 6, 2007 Your probably not an organizer but in my code this is how i would set something up to keep track of it:[code]<?phpif(blahblahblah) { DO STUFF} else { DO OTHER STUFF} // End of if(blahblahblah)?>[/code]label your closings so you know if you closed something or not...use your tab key spread functions out....organize it a bit put things you open on one line the closing on the same and anything you open in between tab once before you do it Quote Link to comment https://forums.phpfreaks.com/topic/33131-solved-php-statements-close-too-early/#findComment-154467 Share on other sites More sharing options...
Asheeown Posted January 6, 2007 Share Posted January 6, 2007 Like jesi said you can post your code and either her or myself can help you fix your problem Quote Link to comment https://forums.phpfreaks.com/topic/33131-solved-php-statements-close-too-early/#findComment-154477 Share on other sites More sharing options...
Mutley Posted January 6, 2007 Author Share Posted January 6, 2007 Fixed it, used the feature in Dreamweaver to "minimize" the code, so I matched every opening bracket to the appropriate closing one. The problem was I had certain functions ending too early before another function, so it just got confused by ending it half way through a function.Thanks guys. Quote Link to comment https://forums.phpfreaks.com/topic/33131-solved-php-statements-close-too-early/#findComment-154487 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.