Jump to content

[SOLVED] Parse error: syntax error, unexpected T_ELSE - Please help... Again


tommyda

Recommended Posts

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';
?>

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

 

 

<?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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.