Ele manda tudo certo para o banco de dados, a index dele mostra as notícias normais, no entanto, ao clicar para mostrar apenas uma notícia completa ele estah dando este erro.
Parse error: syntax error, unexpected $end in /home/esportecoxim/www/fsm_net/exibir.php on line 183
<?
include ("include/conexao.php");
$sql = "SELECT * FROM noticias";
$query = @mysql_query($sql);
if (!$query){
die ("Problemas ao executar o sql !!!");
} else {
while ($coluna = @mysql_fetch_array($query)){
$id = $coluna["id"];
$categoria = $coluna["categoria"];
$subtitulo = $coluna["subtitulo"];
$texto = $coluna["texto"];
$fonte = $coluna["fonte"];
$fonte_foto = $coluna["fonte_foto"];
$data = $coluna["data"];
$hora = $coluna["hora"];
$dstq = $coluna["dstq"];
$foto = $coluna["foto"];
$titulo = $coluna["titulo"];
$titulo = stripslashes($titulo);
$subtitulo = stripslashes($subtitulo);
$texto = stripslashes($texto);
switch ($noticia) {
case "$id":
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>.:: FSM Notícias - A sua identidade digital em informação ::.</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
</style>
</head>
<body>
<table border="0" width="97%" cellpadding="0" cellspacing="4">
<tr>
<td colspan="2" width="72%" align="left" valign="middle"><a name="topo"><font class="cat_data_hora"><? echo "$categoria"; ?>
- <? echo "$data2 - $hora"; ?></font><br><font class="tit"><? echo "$titulo"; ?></font><br>
<font class="sub"><? echo "$subtitulo"; ?></font></td>
</tr>
</table>
<?
break;
}
}
?>
</body>
</html>
Este código está no index.php, que lista todas as notícias, ao clicar ele abre (alias, deveria abrir) apenas aquela clicada.Já me disseram que o switch eh inutil, mas não consegui mudar para o if else.
Alguém poderia me ajudar???
Não entendi esta lógica do switch, ali estah condicionando no caso de $noticia ser igual à $id???
Mas de onde saiu a variável noticia???










