andi: Richtige id auslesen

Hallo Zusammen,
Ich werke schon eine ganze Weile an diesem problem herum.
Meine db sieht folgendermaßen aus:

CREATE TABLE spielplan (
  id int(11) NOT NULL auto_increment,
  titel varchar(100) default NULL,
  genre varchar(100) default NULL,
  beschreibung blob,
  datum date NOT NULL default '0000-00-00',
 PRIMARY KEY  (id)
) TYPE=MyISAM;

Ich möchte nun, wenn ich einen Link auf "titel" setze, das zu diesem Titel die richtige Zeile mittels id ausgelesen wird. dazu habe ich folgende 2 scripts:

index.php

<table width="450" cellspacing="1" cellpadding="3" bgcolor="#ffffff">
<tr>
<td bgcolor="#336699" align="center"><font size="3">Spielplan</font>
</td>
</tr>
</table>
</div>
<br>
<div align=center>
<table width="450" cellspacing="1" cellpadding="3" bgcolor="#ffffff">
<tr>
<td bgcolor="#336699" valign="top"><b>Titel</b></td>
<td bgcolor="#336699" valign="top"><b>Genre</b></td>
<td bgcolor="#336699" valign="top"><b>Datum</b></td>
</TR>
<?
include("config.php");
 mysql_connect($db_host,$db_user,$db_pass) || die("Could not contact mySQL!");
mysql_select_db($db_db) || die("Connected mySQL, but database is unavailable!");
$result=mysql_query("SELECT id, titel, genre, beschreibung, datum, uhrzeit FROM spielplan ORDER BY datum");
while($row=mysql_fetch_array($result))
{
$id=$row["id"];
$titel=$row["titel"];
$genre=$row["genre"];
$beschreibung=$row["beschreibung"];
$datum=$row["datum"];
$datum=explode("-",$row["datum"]);
$datum=$datum[2]. "." .$datum[1]. "." .$datum[0];
?>
<tr>
<td bgcolor="#336699" valign="top"><A HREF=beschreibung.php?sid=$id><? echo $titel ?></a></td>
<td bgcolor="#336699" valign="top"><? echo $genre ?></td>
<td bgcolor="#336699" valign="top"><? echo $datum ?></td>
</tr>
<? } ?>
</table>

^^^^^^^^^^^^^^^^^^^^^^^^^^^^
HIER WIRD DIE ID ABER NICHT ÜBERGEBEN??????????

HIER SOLLTEN NUN DIE EINTRÄGE ZUR ID ANGEZEIGT WERDEN

beschreibung.php

<?
include("config.php");
mysql_connect($db_host,$db_user,$db_pass) || die("Could not contact mySQL!");
mysql_select_db($db_db) || die("Connected mySQL, but database is unavailable!");
$sql1 = "SELECT * FROM spielplan WHERE id = $sid";
$rsMember = mysql_query($sql1);
$sMember = mysql_fetch_row($rsMember);
print("
<html>
<head>
<title>Adresse editieren</title>
<SCRIPT LANGUAGE=JavaScript>
function verify_page()
{
{
document.frmRegister.submit();
}
}
</SCRIPT>
<style>
a:link {color:#ffcc00; text-decoration:none; font-family:arial,helvetica,sans-serif; font-size:9pt;}
a:active {color:#ffcc00; text-decoration:none; font-family:arial,helvetica,sans-serif; font-size:9pt;}
a:visited {color:#ffcc00; text-decoration:none; font-family:arial,helvetica,sans-serif; font-size:9pt;}
a:hover {color:#ffffff; text-decoration:none; font-family:arial,helvetica,sans-serif; font-size:9pt;}
td {font-family:arial,helvetica,sans-serif; color:#ffffff; font-size:9pt;}
</style>
</head>
<BODY bgcolor=#336699>
<BR>
<FORM name=frmRegister action=spielplan_edit_r.php method=post>
<TABLE align="center" cellspacing="1" cellpadding="3" border="0" bgcolor="#ffffff">
<INPUT type=HIDDEN name=txtid value=$sid>
<tr>
<TD bgcolor="#336699" align="center" colspan="2"><b>Film bearbeiten</b><br>
<A HREF=index.php>Zurück zur &Uuml;bersicht</A>
</TR>
<tr>
<TD bgcolor="#336699"> </TD>
<TD bgcolor="#336699"> </TD>
</TR>
<tr>
<TD bgcolor="#336699">Titel:</TD>
<TD bgcolor="#336699">$sMember[1]</TD>
</TR>
<tr>
<TD bgcolor="#336699">Genre:</TD>
<TD bgcolor="#336699">$sMember[2]</TD>
</TR>
<tr>
<TD bgcolor="#336699">Datum:</TD>
<TD bgcolor="#336699">$sMember[4]</TD>
</TR>
</TABLE>
</FORM>
</BODY>
</html>
");
?>

WENN ICH DAS FOLGENDE SCRIPT IN MEINE INDEX.PHP EINBAUE, FUNKTIONIERT DIE GANZE ANGELEGENHEIT´. ICH BRAUCHE ABER DAS ERSTE SCRIPT IN DER INDEX.PHP WEGEN DER DATUMSANZEIGE. WAS MACHE ICH FALSCH??????

<?
include("config.php");
mysql_connect($db_host,$db_user,$db_pass) || die("Could not contact mySQL!");
mysql_select_db($db_db) || die("Connected mySQL, but database is unavailable!");
$sql1 = "SELECT id, titel, genre, beschreibung, datum, uhrzeit FROM spielplan ORDER BY datum;";
$rsMember = mysql_query($sql1);
printf("
<html>
<head>
<title>Spielplan-Admin</title>
<style>
a:link {color:#ffcc00; text-decoration:none; font-family:arial,helvetica,sans-serif; font-size:9pt;}
a:active {color:#ffcc00; text-decoration:none; font-family:arial,helvetica,sans-serif; font-size:9pt;}
a:visited {color:#ffcc00; text-decoration:none; font-family:arial,helvetica,sans-serif; font-size:9pt;}
a:hover {color:#ffffff; text-decoration:none; font-family:arial,helvetica,sans-serif; font-size:9pt;}
td {font-family:arial,helvetica,sans-serif; color:#ffffff; font-size:9pt;}
</style>
</head>
<BODY bgcolor=#336699>
<BR>
<TABLE align="center" cellspacing="1" cellpadding="3" border="0" bgcolor="#ffffff">
<tr>
<td  bgcolor="#336699" colspan=3 align="center" valign="top"><font size=3><b>Spielplan</b><br>
</TR>
<tr>
<td bgcolor="#336699"><b>Titel</b></td>
<td bgcolor="#336699"><b>Genre</b></td>
<td bgcolor="#336699"><b>Datum</b></td>
</tr>
<tr>
<td bgcolor="#336699" colspan=3> </td>
</tr>
");
while ($member = mysql_fetch_row($rsMember))
{
printf("
<tr>
<td bgcolor="#336699" valign="top"><A HREF=beschreibung.php?sid=$member[0]>$member[1]</A></td>
<td bgcolor="#336699" valign="top">$member[2]</td>
<td bgcolor="#336699" valign="top">$member[4]</td>
</tr>
");
}
printf("
</table>
</body>
</html>
");
?>

  1. Hallo,

    ......snip.......

    <tr>
    <td bgcolor="#336699" valign="top"><A HREF=beschreibung.php?sid=$id><? echo $titel ?></a></td>

    ......snip.......

    Sollte es nicht vielmehr <A HREF="beschreibung.php?sid=<?=$id ?>">... heissen??

    Gruss, Mel

    1. Hallo Mel,
      Danke für Deinen Tip.
      Funktioniert super.

      Danke
      Andi