Ver Mensaje Individual
  #1 (permalink)  
Antiguo 12/09/2013, 14:59
Strings
 
Fecha de Ingreso: septiembre-2013
Mensajes: 125
Antigüedad: 10 años, 7 meses
Puntos: 3
¿Seria necesario hacer el if?

En el siguiente codigo seria necesario crear un if?

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;