andi: Eintrag aus DB auslesen

Beitrag lesen

Hallo zusammen,
Ich stehe vor folgendem Problem:
Ich möchte in dem unten angeführten Script
in der Tabellenzeile wo steht "News der Abteilung"
automatisch die jeweilige Abteilung anzeigen.
Es gibt in der DB ein Feld wo die jeweilige Abteilung
eingetragen ist.
Hab schon einiges probiert, was aber leider nicht
richtig funktioniert.

Danke für die Hilfe im vorhinein

Andi

<html>
<head>
<title></title>
<style>
a:link {color:#000000; text-decoration:none; font-family:arial,helvetica,sans-serif; font-size:9pt;}
a:active {color:#000000; text-decoration:none; font-family:arial,helvetica,sans-serif; font-size:9pt;}
a:visited {color:#000000; text-decoration:none; font-family:arial,helvetica,sans-serif; font-size:9pt;}
a:hover {color:#ff0000; text-decoration:none; font-family:arial,helvetica,sans-serif; font-size:9pt;}
td {font-family:arial,helvetica,sans-serif; color:black; font-size :9pt;}
.bold {font-family:arial,helvetica,sans-serif; color:black; font-size:14pt; font-weight:bold}
</style>
</head>
<body bgcolor="#ffffff">
<br>
<?
$db = mysql_connect("","", "");
mysql_select_db("test_db",$db);
$result = mysql_query("SELECT * FROM news WHERE abteilung LIKE '$abt%'",$db);
?>
<table width="500" cellspacing="1" cellpadding="3" bgcolor="#336699">
<TR>
<TD bgcolor="#336699" align="center">
<font size=3" color="#ffffff"><b>News der Abteilung</b></font>
</td>
</tr>
</table>
<br>
<?
while($row=mysql_fetch_array($result))
{
$id=$row["id"];
$titel=$row["titel"];
$abteilung=$row["abteilung"];
$nachricht=$row["nachricht"];
$nachricht = nl2br($nachricht) ;

echo "<table width="500" cellspacing="1" cellpadding="3" bgcolor="#336699">";
echo "<TR>";
echo "<TD bgcolor="#ffffff">";
echo "<b>Titel:</b>".$titel."";
echo "</td>";
echo "</tr>";
echo "<tr>";
echo "<td bgcolor="#ffffff">";
echo "<b>Nachricht:</b>".$nachricht."";
echo "</TD>";
echo "</TR>";
echo "</table>";
echo "<br>";
}
?>
<table cellspacing="1" cellpadding="3" bgcolor="#336699">
<TR>
<TD bgcolor="#ffffff" align="center">
<a href="index.php">zurück zur Newsübersicht</a>
</td>
</tr>
</table>
<br>
</body>
</html>