Sami Posted March 8, 2011 Share Posted March 8, 2011 Parse error: syntax error, unexpected '}' in /home/sami/Dokumenter/local_site/functions.php on line 17 <?php$con = mysql_connect("localhost","root","xxxxx");if (!$con) { die('Could not connect: ' . mysql_error()); }// Functions using MySQLfunction gbok_rm($id) { mysql_select_db("gbok", $con); if(mysql_query("DELETE FROM comments WHERE id='".$id."'")) { return true } }function gbok_ban($ip){mysql_select_db("gbok", $con);if(mysql_query("INSERT INTO banned (ip)VALUES ('".$ip."')")) { return true }}?> I can't see the problem Link to comment Share on other sites More sharing options...
birbal Posted March 8, 2011 Share Posted March 8, 2011 you are missing semicolon here return true; Link to comment Share on other sites More sharing options...
Sami Posted March 8, 2011 Author Share Posted March 8, 2011 you are missing semicolon here return true; thx Link to comment Share on other sites More sharing options...
thescientist Posted March 8, 2011 Share Posted March 8, 2011 it wants you to put semicolons at the end of your lines. Typically the line the error is referencing actually occurs on the line that comes before it. Also, you might want to consider lining up your curlcy braces in an easier to read fashion <?php$con = mysql_connect("localhost","root","xxxxx");if (!$con){ die('Could not connect: ' . mysql_error());}// Functions using MySQLfunction gbok_rm($id){ mysql_select_db("gbok", $con); if(mysql_query("DELETE FROM comments WHERE id='".$id."'")){ return true; //semi-colon added here }}function gbok_ban($ip){ mysql_select_db("gbok", $con); if(mysql_query("INSERT INTO banned (ip) VALUES ('".$ip."')")){ return true //semi-colon added here }}?> Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.