Ive wrote a script that deals with the editing and deleting of articles in a database. To do this I have used nested ifs and a elseif Code: if { //codehere if { //codehere } } elseif { //codehere } else { //codehere } with that I would get a error saying Code: Parse error: syntax error, unexpected '}' in "path" on line 9 I have no idea whats wrong with the code, can some body help me?
I get unexpected T_ELSE. If i remove the else { it will come up with unexpected T_STRING (im using ob_start() and ob_flush() so I can modify the header and redirect the page once one of the ifs have been completed)
Giving that a quick lookover I don't think there is anything wrong with it, somthing else in your code may be causing it, for example missing a ; at the end of the statement can cause an unexpected $ error. If you could post a little more of the code it might help (though I'd assume you wouldn't want to post it) or perhaps just blank out things if you don't want people to steal the script Oh and just a guess, maybe go through and check that every statement is actually ended with a ; the majority of the time I get errors it's usually because I've missed one somewhere.
gives Code: Parse error: syntax error, unexpected '}' on line 47 (which is after the elseif statement) I know it isnt very secure, but Im just creating a base edit/delete script
elseif (isset($id)&&($delete)) { mysql_query("DELETE FROM articles WHERE id=$id"); } Pretty sure that's your problem ( it was missing: ; ), post back if it dosn't work still though (just looked quickly)