-Karl- Posted March 24, 2010 Share Posted March 24, 2010 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. Quote Link to comment Share on other sites More sharing options...
Wolphie Posted March 24, 2010 Share Posted March 24, 2010 No semi-colon at the end of mysql_close($con) Quote Link to comment Share on other sites More sharing options...
-Karl- Posted March 24, 2010 Author Share Posted March 24, 2010 Oh damn yeah! Now I feel dumb. Quote Link to comment 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.