Skip to content

Instantly share code, notes, and snippets.

@fernandoguedes
Last active December 16, 2015 20:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fernandoguedes/5490607 to your computer and use it in GitHub Desktop.
Save fernandoguedes/5490607 to your computer and use it in GitHub Desktop.
<?php
include('conn.php');
mysql_select_db($basedados, $conn);
$qryResultado = "SELECT * FROM noticias ORDER BY id_noticias DESC";
$resResultado = mysql_query($qryResultado, $basedados) or die(mysql_error());
while($linha = mysql_fetch_assoc($resResultado)) {
echo "<h1>".$linha['titulo_noticia']."</h1>";
echo "<br />";
echo "<p>".$linha['texto_noticia']."</p>";
echo "<br />";
}
mysql_close($conn);
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment