Código PHP:
<?php
if(isset($_GET['enviar'])){
$id = mysql_real_escape_string(stripslashes($_GET['id']));
if (is_numeric($id)){
$sql="SELECT titulo, texto FROM noticias WHERE noticias_id = '$id'";
$resultado=mysql_query($sql) or die('<pre>' . mysql_error() . '</pre>' );
$num=mysql_num_rows($resultado);
$i=0;
while ($i < $num) {
$titulo=mysql_fetch_array($resultado,$i,"titulo");
$texto=mysql_fetch_array($resultado,$i,"texto");
echo '<pre>';
echo 'ID: ' . $id . '<br>Titulo da noticia:: ' . $titulo . '<br>Texto da noticia: ' . $texto;
echo '</pre>';
$i++;
}
}
}
?>
Comment