0

hey people . please tell me how to solve this thing . i dont want to see this error again . please tell me . here is the error :


Parse error: syntax error, unexpected $end in /home/awah7870/public_html/cms/blog_prog.php on line 26

and here is the code

<?php
if(isset($_POST['post']))
{
$title = $_POST['title'];
$post = $_POST['post'];
$time = date(d-m-y);
mysql_connect('localhost','awah_awah','awah') or die("cant connect to the server").mysql_error();
  mysql_select_db("awah_admin") or die("cant select hte database ").mysql_error();
$sql = mysql_query("INSERT INTO blog ('title','post','datetime') VALUES ('$title','$post','$time')");
if(!$sql)
{
echo "error: cant insert the values --> ".mysql_error();
}
else
{
echo "done";
}
mysql_close();`
}
?>
2
Contributors
1
Reply
2
Views
6 Years
Discussion Span
Last Post by hielo
0
<?php
if(isset($_POST['post']))
{
$title = $_POST['title'];
$post = $_POST['post'];
$time = date("d-m-y");
mysql_connect('localhost','awah_awah','awah') or die("cant connect to the server".mysql_error() );
  mysql_select_db("awah_admin") or die("can't select hte database " .mysql_error() );
$sql = mysql_query("INSERT INTO blog ('title','post','datetime') VALUES ('$title','$post','$time')");
if(!$sql)
{
echo "error: can't insert the values --> ".mysql_error();
}
else
{
echo "done";
}
mysql_close();` //get rid of this extra "garbage" character you have here
}
?>

Edited by hielo: n/a

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.