Ver Mensaje Individual
  #5 (permalink)  
Antiguo 25/02/2013, 23:47
mathiasmontiel
 
Fecha de Ingreso: febrero-2013
Mensajes: 163
Antigüedad: 11 años, 3 meses
Puntos: 1
Respuesta: Listar campos

gracias a todos, tal vez no me explique bien. esto es lo que estaba tratando de hacer, mi código quedó asi:

<?
$dbhost = "localhost";
$dbuser = "root";
$dbpassword = "";
$dbname = "blog";

$db = mysql_connect($dbhost, $dbuser, $dbpassword) or die("Connection Error: " . mysql_error()); mysql_select_db($dbname) or die("Error al conectar a la base de datos.");

$rows=mysql_query("select * from noticia where categoria = 'deportes'");
?>

<table>
<tr>
<th>Contenido</th>
<th>Categoria</th>
</tr>
<?

while($row=mysql_fetch_array($rows)){
?>
<tr>
<td><? echo $row['contenido'];?></td>
<td><? echo $row['categoria'];?></td>
</tr>
<?
}
?>