Twango Posted March 5, 2011 Share Posted March 5, 2011 I cant tell why this isnt working:<?phpecho "<b>If no 1 Record Added MSG appears, add failed</B>";$mh = "***";$md = "***";$mu = "***";$mp = ***";$con = mysql_connect($mh,$mu,$mp);if ($_POST["Modpass"] == "***"){if (!$con) { die('Could not connect: ' . mysql_error()); }mysql_select_db($md, $con);$sql="INSERT INTO Accounts (Usr, Pw, Special)VALUES('$_POST[Account]','$_POST[Password]','$_POST[special]')";if (!mysql_query($sql,$con)) { die('Error: ' . mysql_error()); }echo "1 record added";mysql_close($con)}?><br/><a href="addus.html">Add</a><br/><a href="userdata.php">List</a>I hid the variables for safety.Why isnt this working?I'd also like to add "else"Thanks, giving error:Parse error: syntax error, unexpected '}' in /home/a5301810/public_html/addus.php on line 30 Link to comment Share on other sites More sharing options...
Ingolme Posted March 5, 2011 Share Posted March 5, 2011 The last closing brace ( } ) of your code is unnecessary. It has no matching brace. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.