Jump to content

Unexpected } Why?


-Karl-

Recommended Posts

if (isset($_POST['submit'])) {

$con = mysql_connect("localhost","****","****");

if (!$con)
  {
  die('Could not connect: ' . mysql_error());
  }
mysql_select_db("***", $con);

$sql="INSERT INTO table (id, name)
VALUES ('','$_POST[name]')";

if (!mysql_query($sql,$con))
  {
  die('Error: ' . mysql_error());
  }
echo "<font color='#FFFFFF' size='2'>1 record added</font>";

mysql_close($con)
}

 

Why does it say the final } is unexpected? I just can't seem to get my head around why.

Link to comment
https://forums.phpfreaks.com/topic/196357-unexpected-why/
Share on other sites

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.