pferdenarre
Also:
Ich habe in der Datenbank eine Tabelle: pferde
In dieser Tabelle sind zwei Zeilen (Pferde) vorhanden.
Jetzt möchte ich alle Pferde mit einem Link untereinander anzeigen lassen.
Siehe hier
Wenn man jetzt aber auf den zweiten Link klickt, kommt man zum ersten Pferd. Die Adresse ist richtig, aber es kommt das falsche Pferd...
Versteht ihr was ich meine?
Es ist wirklich dringend, ich würde mich über eine schnelle Antwort sehr freuen..
Hier der code von datenbank.php
| 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:
|
<html>
<head>
<link rel="stylesheet" type="text/css" href="../style.css">
<title>Verkaufsstall Emmersbach</title>
</head>
<body>
<?php
include("db.php");
$Ergebnis = mysql_query("SELECT * FROM pferde");
if (@mysql_num_rows($Ergebnis) == 0) {
echo "Keine Pferde vorhanden.";
}
else {
while($Data = mysql_fetch_array($Ergebnis)) {
echo "<a href=steckbrief.php?id=$Data[id] target=content>$Data[zuchtname]</a><br>
";
}
}
?>
</body>
</html> |
|
LG Jenni
Morgan Girl
zeig mal den code vom steckbrief, ich glaube da liegt der fehler
Morgan Girl
ist ja klar dass das nciht funktioniert.
du schreibst:
| php: |
1:
2:
3:
|
$id = "$_GET[id]";
$Ergebnis = mysql_query( "SELECT * FROM pferde WHERE verkauf = 'ja'"); |
|
da sagst du php ja auch gar nciht, dass es den steckbrief von dem pferd mit der mitgelieferten id zeigen soll.
das muss nämlich so heißen:
| php: |
1:
2:
3:
|
$id = "$_GET[id]";
$Ergebnis = mysql_query( "SELECT * FROM pferde WHERE id='$id'"); |
|
das mit dem verkauf = ja musst du im ersten code reinmachen!
+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:
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:
144:
145:
146:
147:
148:
149:
150:
151:
152:
153:
154:
155:
156:
157:
158:
159:
160:
161:
162:
163:
164:
165:
166:
167:
168:
169:
170:
171:
172:
173:
174:
175:
176:
177:
178:
179:
180:
181:
182:
183:
184:
185:
186:
187:
188:
189:
190:
191:
192:
193:
194:
195:
196:
197:
198:
199:
200:
201:
202:
203:
204:
205:
206:
207:
208:
209:
210:
211:
212:
213:
214:
215:
216:
217:
218:
219:
220:
221:
222:
223:
224:
|
<html>
<head>
<link rel="stylesheet" type="text/css" href="../style.css">
<title>Verkaufsstall Emmersbach</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[zuchtname]</h1>";
}
?>
<center>
<table width="100%" cellpadding=0>
<tr>
<td class="tadunkel" colspan="3" width="100%">Allgemeines</td>
</tr>
<tr>
<td width="33%" rowspan=6><img src=pferde/<?php echo"$Data[rufname]"?>/vorschau1.jpg border=0 width=162 height=104></td>
<td width="33%" class=tahell>Lebensnummer</td>
<td width="33%"><?php echo"$Data[id]"?></td>
</tr>
<tr>
<td width="33%" class=tahell>Zuchtname</td>
<td width="33%"><?php echo"$Data[zuchtname]"?></td>
</tr>
<tr>
<td width="33%" class=tahell>Rufname</td>
<td width="33%"><?php echo"$Data[rufname]"?></td>
</tr>
<tr>
<td width="33%" class=tahell>Geschlecht</td>
<td width="33%"><?php echo"$Data[geschlecht]"?></td>
</tr>
<tr>
<td width="33%" class=tahell>Alter</td>
<td width="33%"><?php echo"$Data[alter]"?> Jahre</td>
</tr>
<tr>
<td width="33%" class=tahell>Rasse</td>
<td width="33%"><?php echo"$Data[rasse]"?></td>
</tr>
<tr>
<td width=66% colspan=2><iframe src="charakter.php?id=<?php echo"$Data[id]"?>" name="chara" scrolling="auto" width="100%" frameborder="0" height="101"></iframe></td>
<td width=33% rowspan=4><img src=pferde/<?php echo"$Data[rufname]"?>/vorschau2.jpg border=0 width=162 height=156></td>
</tr>
<tr>
<td width=33% class=tahell>Preis</td>
<td width=33%><?php echo"$Data[preis]"?></td>
</tr>
<tr>
<td width=33% class=tahell>Vorsitzer</td>
<td width=33%><?php echo"$Data[vorbesitzer]"?></td>
</tr>
<tr>
<td width=33% class=tahell>Besitzer / Verkäufer</td>
<td width=33%><?php echo"$Data[besitzer]"?></td>
</tr>
<tr>
<td width=100%% class=tadunkel colspan=3>Ausbildung & Potenzial</td>
</tr>
<tr>
<td width=100% colspan=3><img src=pferde/<?php echo"$Data[rufname]"?>/vorschau3.jpg border=0 width=490 height=85></td>
</tr>
<tr>
<td width=33%></td>
<td width=33% class=tahell>Ausbildung</td>
<td width=33% class=tahell>Potenzial</td>
</tr>
<tr>
<td width=33% class=tahell>Dressur</td>
<td width=33%><img src=grafiken/dressur_<?php
if ($dressur_ausb=='') echo "$Data[dressur_ausb]";?>.gif border=0></td>
<td width=33%><img src=grafiken/dressur_<?php
if ($dressur_pot=='') echo "$Data[dressur_pot]";?>.gif border=0></td>
</tr>
<tr>
<td width=33% class=tahell>Springen</td>
<td width=33%><img src=grafiken/dressur_<?php
if ($springen_ausb=='') echo "$Data[springen_ausb]";?>.gif border=0></td>
<td width=33%><img src=grafiken/dressur_<?php
if ($springen_pot=='') echo "$Data[springen_pot]";?>.gif border=0></td>
</tr>
<tr>
<td width=33% class=tahell>Military</td>
<td width=33%><img src=grafiken/dressur_<?php
if ($military_ausb=='') echo "$Data[military_ausb]";?>.gif border=0></td>
<td width=33%><img src=grafiken/dressur_<?php
if ($military_pot=='') echo "$Data[military_pot]";?>.gif border=0></td>
</tr>
<tr>
<td width=33% class=tahell>Fahren</td>
<td width=33%><img src=grafiken/dressur_<?php
if ($fahren_ausb=='') echo "$Data[fahren_ausb]";?>.gif border=0></td>
<td width=33%><img src=grafiken/dressur_<?php
if ($fahren_pot=='') echo "$Data[fahren_pot]";?>.gif border=0></td>
</tr>
<tr>
<td width=100% class=tadunkel colspan=3></td>
</tr>
<tr>
<td width=33% class=tahell>Reining</td>
<td width=33%><img src=grafiken/dressur_<?php
if ($reining_ausb=='') echo "$Data[reining_ausb]";?>.gif border=0></td>
<td width=33%><img src=grafiken/dressur_<?php
if ($reining_pot=='') echo "$Data[reining_pot]";?>.gif border=0></td>
</tr>
<tr>
<td width=33% class=tahell>Trail</td>
<td width=33%><img src=grafiken/dressur_<?php
if ($trail_ausb=='') echo "$Data[trail_ausb]";?>.gif border=0></td>
<td width=33%><img src=grafiken/dressur_<?php
if ($trail_pot=='') echo "$Data[trail_pot]";?>.gif border=0></td>
</tr>
<tr>
<td width=33% class=tahell>Pleasure</td>
<td width=33%><img src=grafiken/dressur_<?php
if ($pleasure_ausb=='') echo "$Data[pleasure_ausb]";?>.gif border=0></td>
<td width=33%><img src=grafiken/dressur_<?php
if ($pleasure_pot=='') echo "$Data[pleasure_pot]";?>.gif border=0></td>
</tr>
<tr>
<td width=33% class=tahell>Cutting</td>
<td width=33%><img src=grafiken/dressur_<?php
if ($cutting_ausb=='') echo "$Data[cutting_ausb]";?>.gif border=0></td>
<td width=33%><img src=grafiken/dressur_<?php
if ($cutting_pot=='') echo "$Data[cutting_pot]";?>.gif border=0></td>
</tr>
<tr>
<td width=100%% class=tadunkel colspan=3>Zucht</td>
</tr>
<tr>
<td width=100%% class=tahell colspan=3>Abstammung</td>
</tr>
<tr>
<td width="33%" rowspan=4><b><?php echo"$Data[rufname]"?></b></td>
<td width="33%" rowspan=2><b><?php echo"$Data[vater]"?></b></td>
<td width="33%"><b><?php echo"$Data[v_opa]"?></b></td>
</tr>
<tr>
<td width="33%"><?php echo"$Data[v_oma]"?></td>
</tr>
<tr>
<td width="33%" rowspan=2><?php echo"$Data[mutter]"?></td>
<td width="33%"><b><?php echo"$Data[m_opa]"?></b></td>
</tr>
<tr>
<td width="33%"><?php echo"$Data[m_oma]"?></td>
</tr>
<tr>
<td width=100%% class=tahell colspan=3>Nachkommen</td>
</tr>
<tr>
<td width="33%" class=tahell>Name</td>
<td width="33%" class=tahell>Hof</td>
<td width="33%" class=tahell>Besitzer</td>
</tr>
<tr>
<td width="33%"><?php echo"$Data[nk_name]"?></td>
<td width="33%"><?php echo"$Data[nk_hof]"?></td>
<td width="33%"><?php echo"$Data[nk_besitzer]"?></td>
</tr>
<tr>
<td width=100%% class=tahell colspan=3>Auszeichnungen</td>
</tr>
<tr>
<td width=33%><img src=pferde/<?php echo"$Data[rufname]"?>/vorschau4.jpg border=0 width=162 height=300></td>
<td width=66% colspan=2><iframe src="auszeichnungen.php?id=<?php echo"$Data[id]"?>" name="ausz" scrolling="auto" width="100%" frameborder="0" height="300"></iframe></td>
</tr>
<tr>
<td width=100%% class=tahell colspan=3>Turniererfolge</td>
</tr>
<tr>
<td width="33%" class=tahell>Datum</td>
<td width="33%" class=tahell>Klasse & Disziplin</td>
<td width="33%" class=tahell>Hof</td>
</tr>
<tr>
<td width="33%"><?php echo"$Data[tur_datum]"?></td>
<td width="33%"><?php echo"$Data[tur_klasse_disziplin]"?></td>
<td width="33%"><?php echo"$Data[tur_hof]"?></td>
</tr>
<tr>
<td width=100%% class=tahell colspan=3>Fotoalbum</td>
</tr>
<tr>
<td width=100%% colspan=3>Wir bedanken uns ganz herzlich bei <?php echo"$Data[copyright]"?> für die freundliche Bereitstellung der Bilder für dieses Pferd.<br><br>
<table width=100%>
<tr>
<td width=20%><a href=pferde/<?php echo"$Data[rufname]"?>/bild1.jpg target=bilder> <img src=pferde/<?php echo"$Data[rufname]"?>/bild1.jpg border=0 width=90></a></td>
<td width=20%><a href=pferde/<?php echo"$Data[rufname]"?>/bild2.jpg target=bilder> <img src=pferde/<?php echo"$Data[rufname]"?>/bild2.jpg border=0 width=90></a></td>
<td width=20%><a href=pferde/<?php echo"$Data[rufname]"?>/bild3.jpg target=bilder> <img src=pferde/<?php echo"$Data[rufname]"?>/bild3.jpg border=0 width=90></a></td>
<td width=20%><a href=pferde/<?php echo"$Data[rufname]"?>/bild4.jpg target=bilder> <img src=pferde/<?php echo"$Data[rufname]"?>/bild4.jpg border=0 width=90></a></td>
<td width=20%><a href=pferde/<?php echo"$Data[rufname]"?>/bild5.jpg target=bilder> <img src=pferde/<?php echo"$Data[rufname]"?>/bild5.jpg border=0 width=90></a></td>
</tr>
<tr>
<td width=20% colspan=5><iframe name="bilder" scrolling="auto" width="100%" frameborder="0" height="300"></iframe></td></td>
</tr>
</table>
</td>
</tr>
</table>
</center>
</body>
</html> |
|
Versuchs mal so...
EDIT: Morgan Girl war schneller