PHP entre codigos HTML
Olá pesso a ajuda de vcs pq sou novato em PHP, fiz um sistema de noticia e coloquei na página principal do site, funcionou tudo corretamente, e gostaria de saber se estou fazendo certo.
código abaixo
<tr>
<td><?
require ("admin/noticias/conectdb.php");
$sql = "SELECT * FROM noticias ORDER BY id DESC LIMIT 3";
$limite = mysql_query("$sql");
while ($sql = mysql_fetch_array ($limite) ) {
$arquivo = $sql['arquivo'];
$id = $sql['id'];
$fonte = $sql['fonte'];
$titulo = $sql['titulo'];
$subtitulo = $sql['subtitulo'];
$texto = $sql['texto'];
$data = $sql['data'];
?>
<table width="100%" border="0" cellspacing="2" cellpadding="3">
<tr>
<td width="8%"><a href="<? echo"ver_noticia.php?id=$id";?>"><img src="<? echo"admin/noticias/$arquivo";?>" alt="" width='50' height="39" border="0" align="texttop"/></a></td>
<td width="92%"><span class="textopequeno"><b><? echo"$titulo";?></b></span><br>
<span class="textopequeno"><? echo"$subtitulo";?></span><br>
<span class="textopequeno"><? echo"$data";?></span></td>
</tr>
</table>
<? } ?>
</td>
</tr>Discussão (12)
Carregando comentários...