HughbertD Posted March 13, 2008 Share Posted March 13, 2008 Hi all, I am getting an "unexpected }" here: echo $content; mysql_close($con) } To me it seems as though all my brckets add up nicely though? Am I missing something? <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Bamboo : Placement Monitoring System</title> </head> <body> <?php if (isset($_POST['updatePlac'])) { $con = mysql_connect("localhost","root","michael"); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("jostark", $con); $sql="insert into studentplacement values ('$_POST[id]','$_POST[placement]','$_POST[startdate]' ,'$_POST[enddate]')"; if (!mysql_query($sql,$con)) { echo ($sql); die('Error: ' . mysql_error()); } $id = $_POST[id]; echo "<b>Record Added Successfully</b>"; $url = "http://localhost/joStark/css/insertUpdateEdit/studentEdit.php?id=$id"; $content = file_get_contents($url); echo $content; mysql_close($con) } if (isset($_POST['updateStud'])) { $con = mysql_connect("localhost","root","michael"); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("jostark", $con); echo " '$_POST[firstname]' '$_POST[mobilenum]'"; $sql="update student set courseID='$_POST[courseID]', firstName = '$_POST[firstname]', lastName = '$_POST[lastName]', otherName = '$_POST[otherName]', title = '$_POST[title]', houseNum = '$_POST[houseNum]', streetName= '$_POST[streetName]', postalTown = '$_POST[postalTown]', city = '$_POST[city]', postCode='$_POST[postCode]', county='$_POST[county]', country='$_POST[country]', termHouseNum='$_POST[termHouseNum]', termStreetName= '$_POST[termStreetName]', termPostalTown = '$_POST[termPostalTown]', termCity = '$_POST[termCity]', termPostCode='$_POST[termPostCode]', termCounty='$_POST[termCounty]', termCountry='$_POST[termCountry]', phoneNum='$_POST[phoneNum]', mobilePhoneNum='$_POST[mobilePhoneNum]', termPhoneNum='$_POST[termPhoneNum]', email='$_POST[email]', termEmail='$_POST[termEmail]', personalEmail='$_POST[personalEmail]', dateOfBirth='$_POST[dateOfBirth]', gender='$_POST[gender]', facebook='$_POST[facebook]', myspace='$_POST[myspace]', homeWebsite='$_POST[homeWebsite]' where studentID= '$_POST[id]'"; if (!mysql_query($sql,$con)) { echo ($sql); die('Error: ' . mysql_error()); } echo ($sql); // echo "<b>Record Added Successfully</b>"; //$url = "http://localhost/joStark/css/display/student/displayStudent.php"; //$content = file_get_contents($url); //echo $content; mysql_close($con); } ?> </body> </html> Quote Link to comment Share on other sites More sharing options...
KrisNz Posted March 13, 2008 Share Posted March 13, 2008 mysql_close($con) semicolon. Quote Link to comment Share on other sites More sharing options...
HughbertD Posted March 13, 2008 Author Share Posted March 13, 2008 Ah-ha! Cheers big-ears! 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.