[PHP & MySQL] Nachkommens Tabelle

BabyHanah
Hallo smile

Da ich grade wieder an der Ds Nevada arbeite, ist mir aufgefallen, was noch fehlt: eine Nachkommenstabelle. Da ich ja noch Anfänger bin, hab ich grade keinen Plan wie ich das erstellen könnte.

Der Steckbriefcode:

php:
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
88:
89:
90:
91:
92:
93:
94:
95:
96:
97:
98:
99:
100:
101:
102:
103:
104:
105:
106:
107:
108:
109:
110:
111:
112:
113:
114:
115:
116:
117:
118:
119:
120:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Deckstation Nevada</title>
   <link rel="stylesheet" href="/style.css"
 type="text/css">
</head>
<body>
<?php
// Verbindung zur Datenbank
include("Datenbank.php");
// Hiermit wird der Wert geholt, der über die URL übergeben wurde. Dieser wird nun für die Abfrage genutzt.
// Somit werden nur genau die Daten abgefragt, die diese ID haben
$id "$_GET[id]";
$Ergebnis mysql_query"SELECT * FROM Pferd where ID='$id'" );
if (@mysql_num_rows($Ergebnis) == 0) {
echo "Dieses Pferd existiert nicht!";
}
else {
$Data mysql_fetch_array$Ergebnis );
//Anzeige der Links (Wenn du den Chara auf mehrere Seiten verteilst
//Hier die Angabe der Daten vom Pferd. Es kann wieder HTML verwendet werden ganz normal eben (; Nur an der Stelle wo die Daten sein sollen schreibt ihr $Data[Spaltenname] hin
echo "<center><a href="Pferd.php?id=$id">Allgemeines</a> && <a href="Pferd2.php?id=$id">Ausbildung &amp; Zucht</a> - - <a href="Pferd3.php?id=$id">Fotoalbum</a><br><br>

<table style="text-alignleft50pxwidth500px;"
 border="0" cellpadding="0" cellspacing="0" class=table2>
  <tbody>
<tr>
<td colspan=3 class=table3>&nbsp;<p>Ausbildung und Zucht von $Data[Name]<p>&nbsp;</td>
</tr>
    <tr>
      <td class=table3 width=33%>&nbsp; &nbsp;Disziplin</td>
      <td class=table3 width=33%>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp;Ausbildung</td>
      <td class=table3 width=33%>&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;
Potential &nbsp; </td>
    </tr>
    <tr>
      <td class=table1>&nbsp;<p>Springen</td>
      <td class=table4>&nbsp;<p>$Data[Springausbildung]</td>
      <td class=table4>&nbsp;<p>$Data[Springpotential]</td>
    </tr>
    <tr>
      <td class=table1>&nbsp;<p>Dressur</td>
      <td class=table4>&nbsp;<p>$Data[Dressurausbildung]</td>
      <td class=table4>&nbsp;<p>$Data[Dressurpotential]</td>
    </tr>
    <tr>
      <td class=table1>&nbsp;<p>Vielseitigkeit</td>
      <td class=table4>&nbsp;<p>$Data[VSausbildung]</td>
      <td class=table4>&nbsp;<p>$Data[VSpotential]</td>
    </tr>
    <tr>
      <td class=table1>&nbsp;<p>Sonstige</td>
      <td class=table4>&nbsp;<p>$Data[sonstaussi]</td>
      <td class=table4>&nbsp;<p>$Data[sonstpoti]</td>
    </tr>
  </tbody>
</table>
<br>
<br>

<table style="text-alignleft50pxwidth500px;"
 border="0" cellpadding="0" cellspacing="0"  class=table2>
  <tbody>
<tr>
<td colspan=3 class=table3>&nbsp;<p>Abstammung/Pedigree<p>&nbsp;</td>
</tr>
    <tr>
      <td width=33%></td>
      <td width=33%></td>
      <td width=33%></td>
    </tr>
    <tr>
      <td></td>
      <td><br>
      </td>
      <td class=table4>$Data[vater2]</td>
    </tr>
    <tr>
      <td><br>
      </td>
      <td class=table4>$Data[vater1]</td>
      <td></td>
    </tr>
    <tr>
      <td class=table1>$Data[Name]</td>
      <td></td>
      <td class=table4>$Data[mutter2]</td>
    </tr>
    <tr>
      <td></td>
      <td></td>
      <td class=table4>$Data[vater3]</td>
    </tr>
    <tr>
      <td></td>
      <td class=table4>$Data[mutter1]</td>
      <td></td>
    </tr>
    <tr>
      <td></td>
      <td></td>
      <td class=table4>$Data[mutter3]</td>
    </tr>
  </tbody>
</table>
<br>

<br>
";
}

?>

</body>
</html>



Ich möchte nämlich eine Tabelle mit: Name, Geschlecht, Hof und Vater/Mutter ..
Hoffe es kann jemand helfen

LG Herz Lea
BabyHanah
Kann mir wirklich keiner helfen? unglücklich
+Debbie+
php:
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
<?php

// Verbindung zur Datenbank
include("Datenbank.php");

$ID "$_GET[ID]";

// Durchsuche Tabelle nachzucht wo die ID = pferde_ID ist
$Ergebnis mysql_query("SELECT * FROM nachzucht WHERE pferde_ID= '$ID'");

// Wenn keine Nachzucht vorhanden ist gib aus
     if (@mysql_num_rows($Ergebnis) == 0) {
    echo " ";
    }

    else {
// Wenn Nachzucht vorhanden ist zeige an
        while($Data mysql_fetch_array($Ergebnis)) {
         echo" <tr>

      <td class="table4" height="22" width="175"><a href="$Data[link]" target="_blank">$Data[name]</a></td>

      <td class="table4" height="22" width="175">$Data[geschlecht]</td>

      <td class="table4" height="22" width="175">$Data[geborenam]</td>

      <td class="table4" height="22" width="175">$Data[hof]</td>

    </tr>";
    }
}
?>


So hab ich es bei mir gemacht. Musst dann eine Tabelle erstellen mit namen nachzucht und die entsprechenden Felder kannst Du ja dann anpassen, ebenso die Ausgabe Augenzwinkern Bei pferde_ID musst Du einfach die ID des Elterntieres eintragen Augenzwinkern