Código PHP:
$news = $connection->prepare("INSERT INTO news(id,user,title,content,date,ip) VALUES ('', '".$_SESSION['username']."', :title, :content, '".date('H:i:s d/m/Y')."','".$_SERVER['REMOTE_ADDR']."')");
$news->bindParam(':title',$_POST['title']);
$news->bindParam(':content',$_POST['content']);
$news->execute();
if($news->rowCount() > 0):
echo 'Noticia creada correctamente';
else:
echo 'Error al crear la noticia';
endif;