SQL语句有误,应改为
$sql = "insert into news(title,dates,contents) values('$title',now(),'$con')";
把$sql输出一下然后吧语句复制到phpmyadmin中执行