-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. Link to comment https://forums.phpfreaks.com/topic/196357-unexpected-why/ 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) Link to comment https://forums.phpfreaks.com/topic/196357-unexpected-why/#findComment-1031035 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. Link to comment https://forums.phpfreaks.com/topic/196357-unexpected-why/#findComment-1031036 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.