hi , my server usually tells me that there is a syntax error so what is it?
the error is in line 12 but i dont know what is it
here is the code :
<?
$mysql_host = "mysql9.000webhost.com";
$mysql_database = "a2354076_post";
$mysql_user = "username";
$mysql_password = "password";
$tbl_name = "posts";
mysql_connect("$mysql_host","$mysql_user","$mysql_password")or die ("cannot connect to DB");
mysql_select_db("$mysql_database")or die("unable to select your database");
$datetime=date("y-m-d h:i:s");
$title=$_POST['title'];
$post=$_POST['post'];
$sql="INSERT INTO $tbl_name(datetime, title, post)values("$datetime","$title","$post")";
$result=mysql_query($sql);
if($result)
{
echo 'success !!!';
echo "<BR>your post is added successfully";
echo "<BR><a href='vew-posts.php'>View posts</a>";
}
else
{
echo "ERROR, your post is not added , please try again or check your database stetup , Awah Mohamad";
}
mysql_close();
?>