tommyda Posted January 23, 2009 Share Posted January 23, 2009 This is the error I am suffering. Parse error: syntax error, unexpected T_ELSE This is the t_else that is causing the error. <?php if(isset($_POST['submit'])) { mysql_query("INSERT INTO reviews (s_id, title, body, userid) VALUES($s_id, $title, $body, $u_id) ") or die(mysql_error()); }; else { echo'form'; ?> Link to comment https://forums.phpfreaks.com/topic/142188-solved-parse-error-syntax-error-unexpected-t_else-please-help-again/ Share on other sites More sharing options...
Mchl Posted January 23, 2009 Share Posted January 23, 2009 if(isset($_POST['submit'])) { mysql_query("INSERT INTO reviews (s_id, title, body, userid) VALUES($s_id, $title, $body, $u_id) ") or die(mysql_error()); }; //you don't need that semicolon here else { echo'form'; } //however you need a brace here Link to comment https://forums.phpfreaks.com/topic/142188-solved-parse-error-syntax-error-unexpected-t_else-please-help-again/#findComment-744828 Share on other sites More sharing options...
Lodius2000 Posted January 23, 2009 Share Posted January 23, 2009 <?php if(isset($_POST['submit'])){ mysql_query("INSERT INTO reviews (s_id, title, body, userid) VALUES($s_id, $title, $body, $u_id) ") or die(mysql_error()); } else { echo'form'; } ?> try that... compare the 2, there were a couple mistakes Link to comment https://forums.phpfreaks.com/topic/142188-solved-parse-error-syntax-error-unexpected-t_else-please-help-again/#findComment-744830 Share on other sites More sharing options...
tommyda Posted January 23, 2009 Author Share Posted January 23, 2009 So it was just the semicolon and the finishing brace. Thanks! Link to comment https://forums.phpfreaks.com/topic/142188-solved-parse-error-syntax-error-unexpected-t_else-please-help-again/#findComment-744831 Share on other sites More sharing options...
Lodius2000 Posted January 24, 2009 Share Posted January 24, 2009 if solved...click solved please Link to comment https://forums.phpfreaks.com/topic/142188-solved-parse-error-syntax-error-unexpected-t_else-please-help-again/#findComment-744871 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.