[PHP & MySQL] PHP-Problem...

pferdenarre
Soo... BlackTear hat sich schon die Zähne daran ausgebissen, jedoch ohne Erfolg^^
Sie sagt sie ist mit ihrem Latein am Ende xD

Es geht darum: ich habe pferdesteckbriefe via php erstellt.
diese steckbriefe haben mehrere seiten und jetzt möchte ich auf die eine seite möchte ich jetzt aus einer anderen Tabelle (berichte) die Berichte einfügen xD

Hier der Code:

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:

<html>

<head>
<link rel="stylesheet" type="text/css" href="../style.css">
<title>Berichte</title>
</head>

<body>

<?php
include("db.php");

$id "$_GET[id]";

$Ergebnis mysql_query"SELECT * FROM pferde where ID='$id'" );
if (@mysql_num_rows($Ergebnis) == 0) {
echo "Kein Pferd vorhanden.";
}

else {
$Data mysql_fetch_array$Ergebnis );


echo "<h1>$Data[Name]</h1>";

}
?>


<center>
<table width="100%">
<tr>
<td class="tadunkel" width="20%"><a href="allgemein.php?id=<?php echo"$_GET[id]?>">Allgemein</a></td>
<td class="tadunkel" width="20%"><a href="ausbildung.php?id=<?php echo"$_GET[id]?>">Ausbildung</a></td>
<td class="tadunkel" width="20%"><a href="zucht-turniere.php?id=<?php echo"$_GET[id]?>">Zucht & Turniere</a></td>
<td class="tadunkel" width="20%"><a href="fotoalbum.php?id=<?php echo"$_GET[id]?>">Fotoalbum</a></td>
<td class="tadunkel" width="20%"><a href="berichte.php?id=<?php echo"$_GET[id]?>">Berichte</a></td>
</tr>
</table>
</center>

<br>

Hier findet ihr die Berichte von <?php echo"$Data[Name]"?>.</br></br>

<?php
include("db.php");

$id "$_GET[id]";

$Ergebnis mysql_query"SELECT * FROM berichte where ID='id'" );

if (@mysql_num_rows($Ergebnis) == 0) {
echo "Du hast keine Pferde.";
}

else {

while($Data mysql_fetch_array($Ergebnis)) {

echo "

<center><table width=80%> 
<tr>
<td colspan=2 class=tadunkel>$Data[Name]</td>
</tr> 
<tr>
<td class=tahell width=50%>Autor</td>
<td width=50%>$Data[Autor]</td>
</tr> 
<tr>
<td class=tahell width=50%>Geschrieben am</td>
<td width=50%>$Data[Datum] um $Data[Uhrzeit]</td>
</tr> 
<tr>
<td class=tahell width=50%>Art</td>
<td width=50%>$Data[Art]</td>
</tr>
<tr>
<td class=tahell width=50%>Zeichen</td>
<td width=50%>$Data[Zeichen]</td>
</tr> 
<tr>
<td class=tahell width=50%>Wörter</td>
<td width=50%>$Data[Wörter]</td>
</tr> 
<tr>
<td class=tahell width=50%>Punkte</td>
<td width=50%>$Data[Punkte]</td>
</tr> 
<tr>
<td colspan=2>$Data[Bericht]</td>
</tr> 
</table></br></center>

";
}

}
?>

</body>
</html>


Ich wäre über jede Hilfe unendlich dankbar.

Ach ja: hier die Seite, auf der eigentlich schon ein Bericht erscheinen sollte:
http://tslalelu.bplaced.net/Verkaufsstal...richte.php?id=6


LG und danke im Vorraus
Jenni
1Sm!le
Ich würd sagen es gibt in der Berichtetabelle wohl keine Berichte, wo in der ID-Spalte 6 steht?!
Was ist in db.php drin, verhakt er sich evtl mit dem doppelten Laden?!
pferdenarre
da sind die Datenbankdaten drin.
Also:

php:
1:
2:
3:
4:
5:
6:
7:
8:
9:
<?
$sqlhost = "localhost";
$sqluser = "tslalelu";
$sqlpassword = "**********";
$sqldb = "tslalelu";

// Verbindung herstellen
mysql_connect($sqlhost,$sqluser,$sqlpassword) or die ("Verbindungsfehler"); mysql_select_db($sqldb) or die ("Keine Datenbank");
?>


und in der Berichtetabelle ist ein Testbericht mit der ID 6 Drin, tut sich aber trotzdem nichts.
.Senseless
In der Zeile 52 kommt doch vor 'id' noch ein $, also '$id'?
pferdenarre
Is ja nich wahr!
Das geht O.o

Du bist toll dankeschööön <33 fröhlich
.Senseless
Freut mich, dass es geht großes Grinsen

Bitteschön^^
pferdenarre
So jetzt habe ich noch ein Problem...
In den Mitgliedersteckbriefen sollen die Berichte ja auch angezeigt werden...
aber auch hier tun sie das nich xD

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:
121:
122:
123:
124:
125:
126:
127:
128:
129:
130:
131:
132:
133:
134:
135:
136:
137:
138:
139:
140:
141:
142:
143:

<html>

<title>Verkaufsstall LaLeLu</title>

<head><base target=home><link rel="stylesheet" type="text/css" href="style.css"></head>

<body>


<?php
include("db.php");

$id "$_GET[id]";

$Ergebnis mysql_query"SELECT * FROM nebenjobs where ID='$id'" );
if (@mysql_num_rows($Ergebnis) == 0) {
echo "Kein Turnierreiter/Tierarzt vorhanden.";
}

else {
$Data mysql_fetch_array$Ergebnis );


echo "<h1>$Data[Name]</h1>";

}
?>

<table width=100%>
<tr>
<td class=tadunkel colspan=2><?php echo"$Data[Name]"?></td>
</tr>
<tr>
<td class=tahell width=50%>Name</td>
<td><?php echo"$Data[Name]"?></td>
</tr>
<tr>
<td class=tahell>E-Mail</td>
<td><a href=mailto:<?php echo"$Data[EMail]"?>><?php echo"$Data[EMail]"?></a></td>
</tr>
<tr>
<td class=tahell>Dabei seit</td>
<td><?php echo"$Data[Dabeiseit]"?></td>
</tr>
<tr>
<td class=tahell>Job</td>
<td><?php echo"$Data[Job]"?></td>
</tr>
<tr>
<td class=tahell>Zahlungsart</td>
<td>Zahlungsart <?php echo"$Data[Zahlungsart]"?></td>
</tr>
<tr>
<td class=tahell>Pferde / behandelte Pferde</td>
<td><?php echo"$Data[Pferde_Behandelte_Pferde]"?></td>
</tr>
<tr>
<td class=tahell>Bereits verdient</td>
<td><?php echo"$Data[Bereits_verdient]"?></td>
</tr>
<tr>
<td class=tadunkel colspan=2>Berichte</td>
</tr>
<tr>
<td colspan=2>

<?php
include("db.php");

$id "$_GET[id]";

$Ergebnis mysql_query"SELECT * FROM berichte where Autor='$Name'" );

if (@mysql_num_rows($Ergebnis) == 0) {
echo "Dieser Autor hat noch keine Berichte geschrieben.";
}

else {

while($Data mysql_fetch_array($Ergebnis)) {

echo "

<center><table width=80%> 
<tr>
<td colspan=2 class=tadunkel>$Data[Name]</td>
</tr> 
<tr>
<td class=tahell width=50%>Pferd</td>
<td width=50%>$Data[Pferd]</td>
</tr> 
<tr>
<td class=tahell width=50%>Geschrieben am</td>
<td width=50%>$Data[Datum] um $Data[Uhrzeit]</td>
</tr> 
<tr>
<td class=tahell width=50%>Art</td>
<td width=50%>$Data[Art]</td>
</tr>
<tr>
<td class=tahell width=50%>Zeichen</td>
<td width=50%>$Data[Zeichen]</td>
</tr> 
<tr>
<td class=tahell width=50%>Wörter</td>
<td width=50%>$Data[Wörter]</td>
</tr> 
<tr>
<td class=tahell width=50%>Punkte</td>
<td width=50%>$Data[Punkte]</td>
</tr> 
<tr>
<td colspan=2>$Data[Bericht]</td>
</tr> 
</table></br></center>

";
}

}
?>


</td>
</tr>
<tr>
<td class=tadunkel colspan=2>Gerittene Turniere (Nur bei Turnierreiter)</td>
</tr>
<tr>
<td class=tahell width=50%>Ausstehende Turniere</td>
<td width=50%><?php echo"$Data[Ausstehende]"?></td>
</tr>
<tr>
<td colspan=2><?php echo"$Data[Gerittene_Turniere]"?></td>
</tr>
</table></br>
<a href=job_verzeichnis.php target=home>zurück zum Verzeichnis</a>

</body>

</html>


Hellp^^
.Senseless
Ersetze

php:
1:
$Ergebnis mysql_query"SELECT * FROM berichte where Autor='$Name'" );


mit

php:
1:
$Ergebnis mysql_query"SELECT * FROM berichte where Autor='$Data[Name]'" );


verwirrt
pferdenarre
Wow das funktioniert^^

Ich bin dir echt was schuldig, danke^^