well, to the problem.
Below is my "savenews.php" a file the user is directed to when trying to add a news item on the blog-site im working with.
Parse error: syntax error, unexpected T_EXIT in savenews.php on line 14
Is all i get when trying to save my news If I remove the if (!mysql_query($sql,$con) and the next line all I get is the Success message but nothing is added to mysql database.
could any1 help me spot the problem?
<?php include ("databaseconnection.php"); //Connection with the mysql-server. mysql_select_db("blog", $con); //Select database to work with. $date = date('Y-m-d H:i:s'); //Assign time/date. $sql="INSERT INTO news (subject, text, date) VALUES ('".mysql_real_escape_string($_POST['subject'])."', '".mysql_real_escape_string($_POST['text'])."', '".$date."')"; //Insert subject, text and date into the table news. if (!mysql_query($sql,$con) die('Error: ' . mysql_error()); echo "Success!"; ?>