Gegen Bilderklau - Das Original (https://www.gegen-bilderklau.net/index.php)
- Design, Website, Copyright (https://www.gegen-bilderklau.net/board.php?boardid=80)
--- Homepagehilfe (https://www.gegen-bilderklau.net/board.php?boardid=27)
---- Homepagehilfe - Archiv (https://www.gegen-bilderklau.net/board.php?boardid=139)
----- [PHP & MySQL] Bilder im Pferdesteckbrief (https://www.gegen-bilderklau.net/thread.php?threadid=166274)


Geschrieben von MissFreaky am 24.12.2009 um 17:20:

  Bilder im Pferdesteckbrief

Huhu,
also ich mache grade meinen neuen Stecki php-tauglich. Die Bilder öffnen sich dort als Tooltip. Allerdings hat jedes Pferd natürlich eine andere Anzahl an Bildern zur Verfügung, hat das Pferd zb nur 4 Bilder möchte ich, dass auch nur 4 angezeigt werden. Hat es 6 sollen 6 Bilder angezeigt werden usw...
Nur, wie mach ich das? Wie soll dann die pferd.php aussehen?

Im Moment siehts leider noch so aus:
http://calvano.bplaced.de/pferd.php?id=1

Maximum sollen 7 Bilder sein.. Aber ich möchte natürlich nicht diese komischen Kreuze da haben xD Also wenn man in der Datenbank für Bild 2, Bild 3 nix angibt soll auch nichts angezeigt werden. Ich hoffe ihr versteht was ich meine und könnt mir helfen.

Hier die pferd.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:
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:
225:
226:
227:
228:
229:
230:
231:
232:
233:
234:
235:
236:
237:
238:
239:
240:
241:
242:
243:
244:
245:
246:
247:
248:
249:
250:
251:
252:
253:
254:
255:
256:
257:
258:
259:
260:
261:
262:
263:
264:
265:
266:
267:
268:
269:
270:
271:
272:
273:
274:
275:
276:
277:
278:
279:
280:
281:
282:
283:
284:
285:
286:
287:
288:
289:
290:
291:
292:
293:
294:
295:
296:
297:
298:
299:
300:
301:
302:
303:
304:
305:
306:
307:
308:
309:
310:
311:
312:
313:
314:
315:
316:
317:
318:
319:
320:
321:
322:
323:
324:
325:

<html>

<head>
<meta http-equiv="Content-Language" content="de">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>Neue Seite 1</title>
<link rel="stylesheet" href="http://calvano.bplaced.de/main.css">
</head>

<body>
<script type="text/javascript" src="http://calvano.bplaced.de/wz_tooltip.js"></script>
<center>


<?php

// Verbindung zur Datenbank
include("db.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 "


<p class="head" align="left">$Data[name]</p>

<p style="margin-top3margin-bottom3" align="left">&nbsp;</p>
<div align="center">
<table class="tablea" border="0" width="450" cellspacing="0" cellpadding="5">
  <tr>
    <td class="neu" width="430" colspan="4">
      <p align="center"><b>$Data[name]</b></p>
    </td>
  </tr>
  <tr>
    <td class="tdb" width="173" colspan="2">

      <p align="center"><img border="0" src="http://calvano.bplaced.de/bilder/$Data[vorschaupic]" align="center"></td>
    <td class="tdd" width="257" colspan="2">
      <table border="0" width="100%">
        <tr>
          <td width="50%"><font size="1">ID</font></td>
          <td width="50%"><font size="1">$Data[ID]</font></td>
        </tr>
        <tr>

          <td width="50%"><font size="1">Alter</font></td>
          <td width="50%"><font size="1">$Data[alter]</font></td>
        </tr>
        <tr>
          <td width="50%"><font size="1">Rasse</font></td>
          <td width="50%"><font size="1">$Data[rasse]</font></td>

        </tr>
        <tr>
          <td width="50%"><font size="1">Geschlecht</font></td>
          <td width="50%"><font size="1">$Data[geschlecht]</font></td>
        </tr>
        <tr>
          <td width="50%"><font size="1">Stockmaß</font></td>

          <td width="50%"><font size="1">$Data[stockmaß]</font></td>
        </tr>
        <tr>
          <td width="50%"><font size="1">Wert</font></td>
          <td width="50%"><font size="1">$Data[wert</font></td>
        </tr>
        <tr>

          <td width="50%"><font size="1">Besitzer</font></td>
          <td width="50%"><font size="1">$Data[besitzer]</font></td>
        </tr>
      </table>
    </td>
  </tr>
  <tr>
    <td class="tdd" width="430" colspan="4">

      <p align="center"><font size="1">Danke an <a href="$Data[copyrightaddy]target="_blank"><font color="#FFFFFF">$Data[copyright]</font></afür die Bilder !</font></td>
  </tr>
  <tr>
    <td class="neu" width="430" colspan="4" align="center">Charakter und Verhalten</td>
  </tr>
  <tr>

    <td class="tda" width="430" colspan="4" align="center">Charakter</td>
  </tr>
  <tr>
    <td class="tdd" width="430" colspan="4"><font size="1">$Data[charakter]</font></td>
  </tr>
  <tr>
    <td class="tda" width="220" align="center" colspan="2">

      <p align="center"><font size="1"><b>V</b>erladefromm</font></td>
    <td class="tdb" width="210" align="left" colspan="2">
      <p align="left"><img border="0" src="http://calvano.bplaced.de/Graphiken Button/stats$Data[verladefromm].gif"></td>
  </tr>
  <tr>
    <td class="tda" width="220" align="center" colspan="2"><font size="1"><b>S</b>chmiedefromm</font></td>
    <td class="tdb" width="210" align="left" colspan="2"><img border="0" src="http://calvano.bplaced.de/Graphiken Button/stats$Data[schmiedefromm].gif"></td>

  </tr>
  <tr>
    <td class="tda" width="220" align="center" colspan="2"><font size="1"><b>U</b>mgang</font></td>
    <td class="tdb" width="210" align="left" colspan="2"><img border="0" src="http://calvano.bplaced.de/Graphiken Button/stats$Data[umgang].gif"></td>
  </tr>
  <tr>
    <td class="tda" width="220" align="center" colspan="2"><font size="1"><b>S</b>chreckhaftigkeit</font></td>

    <td class="tdb" width="210" align="left" colspan="2"><img border="0" src="http://calvano.bplaced.de/Graphiken Button/stats$Data[schreckhaftigkeit].gif"></td>
  </tr>
  <tr>
    <td class="neu" width="430" colspan="4">
      <p align="center">Fotoalbum</p>
    </td>
  </tr>
  <tr>

    <td class="tdd" width="430" align="center" colspan="4">
<img src="http://calvano.bplaced.de/bilder/$Data[Tooltip1]onmouseover="Tip('<img src=\'http://calvano.bplaced.de/bilder/$Data[bild1]\' width=\'553\' height=\'367\'>', BORDERWIDTH, 0, BGCOLOR, '')" onmouseout="UnTip()" width="50" height="50">&nbsp;
<img src="http://calvano.bplaced.de/bilder/$Data[Tooltip2]onmouseover="Tip('<img src=\'http://calvano.bplaced.de/bilder/$Data[bild2]\' width=\'553\' height=\'367\'>', BORDERWIDTH, 0, BGCOLOR, '')" onmouseout="UnTip()" width="50" height="50">&nbsp;
<img src="http://calvano.bplaced.de/bilder/$Data[Tooltip3]onmouseover="Tip('<img src=\'http://calvano.bplaced.de/bilder/$Data[bild3]\' width=\'553\' height=\'367\'>', BORDERWIDTH, 0, BGCOLOR, '')" onmouseout="UnTip()" width="50" height="50">&nbsp;
<img src="http://calvano.bplaced.de/bilder/$Data[Tooltip4]onmouseover="Tip('<img src=\'http://calvano.bplaced.de/bilder/$Data[bild4]\' width=\'553\' height=\'367\'>', BORDERWIDTH, 0, BGCOLOR, '')" onmouseout="UnTip()" width="50" height="50">&nbsp;
<img src="http://calvano.bplaced.de/bilder/$Data[Tooltip5]onmouseover="Tip('<img src=\'http://calvano.bplaced.de/bilder/$Data[bild5]\' width=\'553\' height=\'367\'>', BORDERWIDTH, 0, BGCOLOR, '')" onmouseout="UnTip()" width="50" height="50">&nbsp;
<img src="http://calvano.bplaced.de/bilder/$Data[Tooltip6]onmouseover="Tip('<img src=\'http://calvano.bplaced.de/bilder/$Data[bild6]\' width=\'553\' height=\'367\'>', BORDERWIDTH, 0, BGCOLOR, '')" onmouseout="UnTip()" width="50" height="50">&nbsp;
<img src="http://calvano.bplaced.de/bilder/$Data[Tooltip7]onmouseover="Tip('<img src=\'http://calvano.bplaced.de/bilder/$Data[bild7]\' width=\'553\' height=\'367\'>', BORDERWIDTH, 0, BGCOLOR, '')" onmouseout="UnTip()" width="50" height="50">




    </td>
  </tr>

  <tr>
    <td class="neu" width="430" colspan="4">
      <p align="center">Ausbildung</p>
    </td>
  </tr>

  <tr>
    <td class="tdd" width="430" colspan="4">
      <table border="0" width="100%">

        <tr>
          <td width="33%" align="center">Dressur</td>
          <td width="33%" align="center">Springen</td>
          <td width="34%" align="center">Vielseitigkeit</td>
        </tr>
      </table>
    </td>

  </tr>

  <tr>
    <td class="tdd" width="430" colspan="4">
      <table border="0" width="100%">
        <tr>
          <td width="33%">


<p align="center" style="margin-top: -2; margin-bottom: -2"><img border="0" src="http://calvano.bplaced.de/Graphiken Button/Ausb$Data[Dressurausbildung].png" width="105" height="18"></p>
<p align="center" style="margin-top: -2; margin-bottom: -2"><font size="1">Ausbildung</font></p>

<p align="center" style="margin-top: -2; margin-bottom: -2">&nbsp;</p>
<p align="center" style="margin-top: -2; margin-bottom: -2"><img border="0" src="http://calvano.bplaced.de/Graphiken Button/Ausb$Data[Dressurpotenzial].png" width="105" height="18"></p>
<p align="center" style="margin-top: -2; margin-bottom: -2"><font size="1">Potenzial</font></p>


          </td>
          <td width="33%">


<p align="center" style="margin-top: -2; margin-bottom: -2"><img border="0" src="http://calvano.bplaced.de/Graphiken Button/Ausb$Data[Springausbildung].png" width="105" height="18"></p>
<p align="center" style="margin-top: -2; margin-bottom: -2"><font size="1">Ausbildung</font></p>
<p align="center" style="margin-top: -2; margin-bottom: -2">&nbsp;</p>
<p align="center" style="margin-top: -2; margin-bottom: -2"><img border="0" src="http://calvano.bplaced.de/Graphiken Button/Ausb$Data[Springpotenzial].png" width="105" height="18"></p>
<p align="center" style="margin-top: -2; margin-bottom: -2"><font size="1">Potenzial</font></p>


          </td>
          <td width="34%">


<p align="center" style="margin-top: -2; margin-bottom: -2"><img border="0" src="http://calvano.bplaced.de/Graphiken Button/Ausb$Data[VSausbildung].png" width="105" height="18"></p>
<p align="center" style="margin-top: -2; margin-bottom: -2"><font size="1">Ausbildung</font></p>
<p align="center" style="margin-top: -2; margin-bottom: -2">&nbsp;</p>
<p align="center" style="margin-top: -2; margin-bottom: -2"><img border="0" src="http://calvano.bplaced.de/Graphiken Button/Ausb$Data[VSpotenzial].png" width="105" height="18"></p>
<p align="center" style="margin-top: -2; margin-bottom: -2"><font size="1">Potenzial</font></p>


          </td>
        </tr>
      </table>
    </td>
  </tr>

  <tr>
    <td class="tda" width="215" colspan="2">Western</td>

    <td class="tdb" width="215" colspan="2">$Data[western]</td>
  </tr>

  <tr>
    <td class="tda" width="215" colspan="2">Fahren</td>
    <td class="tdb" width="215" colspan="2">$Data[fahren]</td>
  </tr>

  <tr>
    <td class="neu" width="430" colspan="4">
      <p align="center">Stammbaum und Zuchtinfos</td>
  </tr>

  <tr>
    <td class="tdd" width="430" colspan="4">
      <table border="0" width="100%">
        <tr>

          <td width="34%" rowspan="4" align="center"><font size="1">$Data[name]</font></td>
          <td width="33%" rowspan="2" align="center"><font size="1">$Data[Vater]</font></td>
          <td width="33%" align="center"><font size="1">$Data[VatervonVater]</font></td>
        </tr>
        <tr>
          <td width="33%" align="center"><font size="1">$Data[MuttervonVater]</font></td>
        </tr>

        <tr>
          <td width="33%" rowspan="2" align="center"><font size="1">$Data[Mutter]</font></td>
          <td width="33%" align="center"><font size="1">$Data[VatervonMutter]</font></td>
        </tr>
        <tr>
          <td width="33%" align="center"><font size="1">$Data[MuttervonMutter]</font></td>
        </tr>

      </table>
    </td>
  </tr>

  <tr>
    <td class="tda" width="108" align="left">Zuchtzulassung</td>
    <td class="tdb" width="108" align="left"><img border="0" src="http://calvano.bplaced.de/Graphiken Button/$Data[Zuchtzulassung].gif" width="15" height="15"></td>
    <td class="tda" width="107" align="left">Decktaxe</td>

    <td class="tdb" width="107" align="left">$Data[Decktaxe</td>
  </tr>

  <tr>
    <td class="tda" width="108" align="left">
      <p align="left">Nachkommen</p>
    </td>
    <td class="tdb" width="108" align="left">

      <p align="left">$Data[Nachkommen]</td>
    <td class="tda" width="107" align="left">Status</td>
    <td class="tdb" width="107" align="left">$Data[Status]</td>
  </tr>

  <tr>
    <td class="neu" width="430" colspan="4">
      <p align="center">Sonstiges</p>

    </td>
  </tr>

  <tr>
    <td class="tdd" width="215" colspan="2">Gesundheit und Wohlbefinden</td>
    <td class="tdd" width="215" colspan="2"><img border="0" src="http://calvano.bplaced.de/Graphiken Button/PixelProzent$Data[Gesundheit].png"></td>
  </tr>

  <tr>

    <td class="tdd" width="215" colspan="2">Stall</td>
    <td class="tdd" width="215" colspan="2">$Data[Stall]</td>
  </tr>

  <tr>
    <td class="tdd" width="215" colspan="2">Futterplan</td>
    <td class="tdd" width="215" colspan="2">$Data[Futterplan]</td>

  </tr>

  <tr>
    <td class="tdd" width="215" colspan="2">Pfleger</td>
    <td class="tdd" width="215" colspan="2">$Data[Pfleger]</td>
  </tr>


  <tr>
    <td class="tda" width="430" colspan="4" align="center">Erfolge und Auszeichnungen</td>

  </tr>


  <tr>
    <td class="tdb" width="430" colspan="4" align="center">$Data[Erfolge]</td>
  </tr>
</table>

</div>
<br>

";
}
?>


</center>
</body>
</html>


lg, missfreaky



Geschrieben von Black Katrin am 25.12.2009 um 10:42:

 

ich gelte jetzt sicher gleich wieder als unhöflich, aber das ist mir ziemlich egal!

woran erkennt man, dass du wenig gelesen hast bis jetzt? du kennst nicht mal die wichtigsten Schleifen/Abfragen!

Ich geb dir jetzt einfach nen Stichwort wo in diesem Fall hilft: If-Abfrage, du wirst genügend infos drüber finden wenn du suchst um dein problem zu lösen.

und dan solltest du dich auch mit diesen schleifen noch auseinander setzten: for & while



Geschrieben von Julia712 am 25.12.2009 um 10:52:

 

Hey,

also erst einmal an Black Kathrin: Es gibt keine If-Schleife! Es handelt sich dabei nämlich lediglich um eine Verzweigung/Abfrage und nicht um eine Schleife. Solltest du eigentlich wissen, nicht?

So, nun aber zu deinem Problem smile
Schau doch mal, was du in der Datenbank zB in dem Feld vorschaubild stehen hast. Das PHP-Skript versucht nämlich das Bild mit dem Pfad "http://calvano.bplaced.de/bilder/name" einzubinden, aber das gibt es natürlich nicht Augenzwinkern
Du musst schon darauf achten, dass der richtige Pfad in der Datenbank steht.


Lg, Julia



Geschrieben von Black Katrin am 25.12.2009 um 11:00:

 

volltreffer Freude habs editiert... peinlich, peinlich XD



Geschrieben von MissFreaky am 26.12.2009 um 18:31:

 

Ich habs jetzt mal so versucht. Egal was ich bei "anzahl" in der DB angebe werden allerdings 2 Bilder angezeigt xD
Wie gesagt ich bin php Anfänger und ich hab nie irgendwo geschrieben dass ich alles super gut kann oder so großes Grinsen

Würd einfach gerne wissen wo der Fehler ist damit ich weiterkomme und dazulerne.

Hier der Codeteil:

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:

<?php
   include('db.php');
$id "$_GET[id]";


$pics mysql_query"SELECT anzahl FROM pferd where ID='$id'" );
if (@mysql_num_rows($pics) != '1') {
        echo "<img src="http://calvano.bplaced.de/bilder/$Data[Tooltip1]" onmouseover="Tip('<img src=\'http://calvano.bplaced.de/bilder/$Data[bild1]\' width=\'553\' height=\'367\'>', BORDERWIDTH, 0, BGCOLOR, '')" onmouseout="UnTip()" width="50" height="50">&nbsp;";
    }
    elseif (@mysql_num_rows($pics) != "2") {
        echo "<img src="http://calvano.bplaced.de/bilder/$Data[Tooltip1]" onmouseover="Tip('<img src=\'http://calvano.bplaced.de/bilder/$Data[bild1]\' width=\'553\' height=\'367\'>', BORDERWIDTH, 0, BGCOLOR, '')" onmouseout="UnTip()" width="50" height="50">&nbsp;
<img src="http://calvano.bplaced.de/bilder/$Data[Tooltip2]onmouseover="Tip('<img src=\'http://calvano.bplaced.de/bilder/$Data[bild2]\' width=\'553\' height=\'367\'>', BORDERWIDTH, 0, BGCOLOR, '')" onmouseout="UnTip()" width="50" height="50">&nbsp;";
    }
    elseif (@mysql_num_rows($pics) != "3") {
        echo "<img src="http://calvano.bplaced.de/bilder/$Data[Tooltip1]onmouseover="Tip('<img src=\'http://calvano.bplaced.de/bilder/$Data[bild1]\' width=\'553\' height=\'367\'>', BORDERWIDTH, 0, BGCOLOR, '')" onmouseout="UnTip()" width="50" height="50">&nbsp;
<img src="http://calvano.bplaced.de/bilder/$Data[Tooltip2]onmouseover="Tip('<img src=\'http://calvano.bplaced.de/bilder/$Data[bild2]\' width=\'553\' height=\'367\'>', BORDERWIDTH, 0, BGCOLOR, '')" onmouseout="UnTip()" width="50" height="50">&nbsp;
<img src="http://calvano.bplaced.de/bilder/$Data[Tooltip3]onmouseover="Tip('<img src=\'http://calvano.bplaced.de/bilder/$Data[bild3]\' width=\'553\' height=\'367\'>', BORDERWIDTH, 0, BGCOLOR, '')" onmouseout="UnTip()" width="50" height="50">&nbsp;";
    }
    elseif (@mysql_num_rows($pics) != "4") {
        echo "<img src="http://calvano.bplaced.de/bilder/$Data[Tooltip1]onmouseover="Tip('<img src=\'http://calvano.bplaced.de/bilder/$Data[bild1]\' width=\'553\' height=\'367\'>', BORDERWIDTH, 0, BGCOLOR, '')" onmouseout="UnTip()" width="50" height="50">&nbsp;
<img src="http://calvano.bplaced.de/bilder/$Data[Tooltip2]onmouseover="Tip('<img src=\'http://calvano.bplaced.de/bilder/$Data[bild2]\' width=\'553\' height=\'367\'>', BORDERWIDTH, 0, BGCOLOR, '')" onmouseout="UnTip()" width="50" height="50">&nbsp;
<img src="http://calvano.bplaced.de/bilder/$Data[Tooltip3]onmouseover="Tip('<img src=\'http://calvano.bplaced.de/bilder/$Data[bild3]\' width=\'553\' height=\'367\'>', BORDERWIDTH, 0, BGCOLOR, '')" onmouseout="UnTip()" width="50" height="50">&nbsp;
<img src="http://calvano.bplaced.de/bilder/$Data[Tooltip4]onmouseover="Tip('<img src=\'http://calvano.bplaced.de/bilder/$Data[bild4]\' width=\'553\' height=\'367\'>', BORDERWIDTH, 0, BGCOLOR, '')" onmouseout="UnTip()" width="50" height="50">&nbsp;";
    }
    elseif (@mysql_num_rows($pics) != "5") {
        echo "<img src="http://calvano.bplaced.de/bilder/$Data[Tooltip1]onmouseover="Tip('<img src=\'http://calvano.bplaced.de/bilder/$Data[bild1]\' width=\'553\' height=\'367\'>', BORDERWIDTH, 0, BGCOLOR, '')" onmouseout="UnTip()" width="50" height="50">&nbsp;
<img src="http://calvano.bplaced.de/bilder/$Data[Tooltip2]onmouseover="Tip('<img src=\'http://calvano.bplaced.de/bilder/$Data[bild2]\' width=\'553\' height=\'367\'>', BORDERWIDTH, 0, BGCOLOR, '')" onmouseout="UnTip()" width="50" height="50">&nbsp;
<img src="http://calvano.bplaced.de/bilder/$Data[Tooltip3]onmouseover="Tip('<img src=\'http://calvano.bplaced.de/bilder/$Data[bild3]\' width=\'553\' height=\'367\'>', BORDERWIDTH, 0, BGCOLOR, '')" onmouseout="UnTip()" width="50" height="50">&nbsp;
<img src="http://calvano.bplaced.de/bilder/$Data[Tooltip4]onmouseover="Tip('<img src=\'http://calvano.bplaced.de/bilder/$Data[bild4]\' width=\'553\' height=\'367\'>', BORDERWIDTH, 0, BGCOLOR, '')" onmouseout="UnTip()" width="50" height="50">&nbsp;
<img src="http://calvano.bplaced.de/bilder/$Data[Tooltip5]onmouseover="Tip('<img src=\'http://calvano.bplaced.de/bilder/$Data[bild5]\' width=\'553\' height=\'367\'>', BORDERWIDTH, 0, BGCOLOR, '')" onmouseout="UnTip()" width="50" height="50">&nbsp;";
    }
    elseif (@mysql_num_rows($pics) != "6") {
        echo "<img src="http://calvano.bplaced.de/bilder/$Data[Tooltip1]onmouseover="Tip('<img src=\'http://calvano.bplaced.de/bilder/$Data[bild1]\' width=\'553\' height=\'367\'>', BORDERWIDTH, 0, BGCOLOR, '')" onmouseout="UnTip()" width="50" height="50">&nbsp;
<img src="http://calvano.bplaced.de/bilder/$Data[Tooltip2]onmouseover="Tip('<img src=\'http://calvano.bplaced.de/bilder/$Data[bild2]\' width=\'553\' height=\'367\'>', BORDERWIDTH, 0, BGCOLOR, '')" onmouseout="UnTip()" width="50" height="50">&nbsp;
<img src="http://calvano.bplaced.de/bilder/$Data[Tooltip3]onmouseover="Tip('<img src=\'http://calvano.bplaced.de/bilder/$Data[bild3]\' width=\'553\' height=\'367\'>', BORDERWIDTH, 0, BGCOLOR, '')" onmouseout="UnTip()" width="50" height="50">&nbsp;
<img src="http://calvano.bplaced.de/bilder/$Data[Tooltip4]onmouseover="Tip('<img src=\'http://calvano.bplaced.de/bilder/$Data[bild4]\' width=\'553\' height=\'367\'>', BORDERWIDTH, 0, BGCOLOR, '')" onmouseout="UnTip()" width="50" height="50">&nbsp;
<img src="http://calvano.bplaced.de/bilder/$Data[Tooltip5]onmouseover="Tip('<img src=\'http://calvano.bplaced.de/bilder/$Data[bild5]\' width=\'553\' height=\'367\'>', BORDERWIDTH, 0, BGCOLOR, '')" onmouseout="UnTip()" width="50" height="50">&nbsp;
<img src="http://calvano.bplaced.de/bilder/$Data[Tooltip6]onmouseover="Tip('<img src=\'http://calvano.bplaced.de/bilder/$Data[bild6]\' width=\'553\' height=\'367\'>', BORDERWIDTH, 0, BGCOLOR, '')" onmouseout="UnTip()" width="50" height="50">&nbsp;";
    }
    elseif (@mysql_num_rows($pics) != "7") {
        echo "<img src="http://calvano.bplaced.de/bilder/$Data[Tooltip1]onmouseover="Tip('<img src=\'http://calvano.bplaced.de/bilder/$Data[bild1]\' width=\'553\' height=\'367\'>', BORDERWIDTH, 0, BGCOLOR, '')" onmouseout="UnTip()" width="50" height="50">&nbsp;
<img src="http://calvano.bplaced.de/bilder/$Data[Tooltip2]onmouseover="Tip('<img src=\'http://calvano.bplaced.de/bilder/$Data[bild2]\' width=\'553\' height=\'367\'>', BORDERWIDTH, 0, BGCOLOR, '')" onmouseout="UnTip()" width="50" height="50">&nbsp;
<img src="http://calvano.bplaced.de/bilder/$Data[Tooltip3]onmouseover="Tip('<img src=\'http://calvano.bplaced.de/bilder/$Data[bild3]\' width=\'553\' height=\'367\'>', BORDERWIDTH, 0, BGCOLOR, '')" onmouseout="UnTip()" width="50" height="50">&nbsp;
<img src="http://calvano.bplaced.de/bilder/$Data[Tooltip4]onmouseover="Tip('<img src=\'http://calvano.bplaced.de/bilder/$Data[bild4]\' width=\'553\' height=\'367\'>', BORDERWIDTH, 0, BGCOLOR, '')" onmouseout="UnTip()" width="50" height="50">&nbsp;
<img src="http://calvano.bplaced.de/bilder/$Data[Tooltip5]onmouseover="Tip('<img src=\'http://calvano.bplaced.de/bilder/$Data[bild5]\' width=\'553\' height=\'367\'>', BORDERWIDTH, 0, BGCOLOR, '')" onmouseout="UnTip()" width="50" height="50">&nbsp;
<img src="http://calvano.bplaced.de/bilder/$Data[Tooltip6]onmouseover="Tip('<img src=\'http://calvano.bplaced.de/bilder/$Data[bild6]\' width=\'553\' height=\'367\'>', BORDERWIDTH, 0, BGCOLOR, '')" onmouseout="UnTip()" width="50" height="50">&nbsp;
<img src="http://calvano.bplaced.de/bilder/$Data[Tooltip7]onmouseover="Tip('<img src=\'http://calvano.bplaced.de/bilder/$Data[bild7]\' width=\'553\' height=\'367\'>', BORDERWIDTH, 0, BGCOLOR, '')" onmouseout="UnTip()" width="50" height="50">";
    }
    else {
        echo "Keine Bilder vorhanden";
    }
?>



Geschrieben von Stelo am 26.12.2009 um 19:30:

 

Also so ganz erschließt sich mir hier der Sinn noch nicht, aber ich versuche mal mein Glück.

1. Statt so vielen elseif Abfragen, solltest du es vllt. mal mit "switch" probieren, ist extra dafür gemacht. smile
2. Warum sagst du denn '!= 1'? Müsste das nicht immer ein '=' sein?
3. Zahlen werden nicht in '' geschrieben, nur Strings.
4. Warum mysql_num_rows? Das zählt doch die Einträge? Willst du nicht einfach nur 'anzahl' aus der DB auslesen? (-->mysql_fetch_assoc)



Geschrieben von MissFreaky am 26.12.2009 um 19:43:

 

Hallo, danke schonmal für deine Hilfe aber jetzt kommt ne Fehlermeldung.
Also damits man versteht: Ich habe in der Datenbank 'anzahl' stehen dort steht halt die zahl von 1-7, je nachdem wie viele bilder das pferd hat. ZB ist Anzahl = 1 soll das erste ausgegeben werden. Ist Anzahl = 2 sollen 2 Bilder ausgegeben werden.

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:
<?php
   include('db.php');
$id "$_GET[id]";


$pics mysql_query"SELECT anzahl FROM pferd where ID='$id'" );
if (@mysql_fetch_assoc($pics) = 1) {
        echo "<img src="http://calvano.bplaced.de/bilder/$Data[Tooltip1]" onmouseover="Tip('<img src=\'http://calvano.bplaced.de/bilder/$Data[bild1]\' width=\'553\' height=\'367\'>', BORDERWIDTH, 0, BGCOLOR, '')" onmouseout="UnTip()" width="50" height="50">&nbsp;";
    }
    elseif (@mysql_fetch_assoc($pics) = 2) {
        echo "<img src="http://calvano.bplaced.de/bilder/$Data[Tooltip1]" onmouseover="Tip('<img src=\'http://calvano.bplaced.de/bilder/$Data[bild1]\' width=\'553\' height=\'367\'>', BORDERWIDTH, 0, BGCOLOR, '')" onmouseout="UnTip()" width="50" height="50">&nbsp;
<img src="http://calvano.bplaced.de/bilder/$Data[Tooltip2]onmouseover="Tip('<img src=\'http://calvano.bplaced.de/bilder/$Data[bild2]\' width=\'553\' height=\'367\'>', BORDERWIDTH, 0, BGCOLOR, '')" onmouseout="UnTip()" width="50" height="50">&nbsp;";
    }
    elseif (@mysql_fetch_assoc($pics) = 3) {
        echo "<img src="http://calvano.bplaced.de/bilder/$Data[Tooltip1]onmouseover="Tip('<img src=\'http://calvano.bplaced.de/bilder/$Data[bild1]\' width=\'553\' height=\'367\'>', BORDERWIDTH, 0, BGCOLOR, '')" onmouseout="UnTip()" width="50" height="50">&nbsp;
<img src="http://calvano.bplaced.de/bilder/$Data[Tooltip2]onmouseover="Tip('<img src=\'http://calvano.bplaced.de/bilder/$Data[bild2]\' width=\'553\' height=\'367\'>', BORDERWIDTH, 0, BGCOLOR, '')" onmouseout="UnTip()" width="50" height="50">&nbsp;<img src="http://calvano.bplaced.de/bilder/$Data[Tooltip3]onmouseover="Tip('<img src=\'http://calvano.bplaced.de/bilder/$Data[bild3]\' width=\'553\' height=\'367\'>', BORDERWIDTH, 0, BGCOLOR, '')" onmouseout="UnTip()" width="50" height="50">&nbsp;";
    }
    elseif (@mysql_fetch_assoc($pics) = 4) {
        echo "<img src="http://calvano.bplaced.de/bilder/$Data[Tooltip1]onmouseover="Tip('<img src=\'http://calvano.bplaced.de/bilder/$Data[bild1]\' width=\'553\' height=\'367\'>', BORDERWIDTH, 0, BGCOLOR, '')" onmouseout="UnTip()" width="50" height="50">&nbsp;
<img src="http://calvano.bplaced.de/bilder/$Data[Tooltip2]onmouseover="Tip('<img src=\'http://calvano.bplaced.de/bilder/$Data[bild2]\' width=\'553\' height=\'367\'>', BORDERWIDTH, 0, BGCOLOR, '')" onmouseout="UnTip()" width="50" height="50">&nbsp;
<img src="http://calvano.bplaced.de/bilder/$Data[Tooltip3]onmouseover="Tip('<img src=\'http://calvano.bplaced.de/bilder/$Data[bild3]\' width=\'553\' height=\'367\'>', BORDERWIDTH, 0, BGCOLOR, '')" onmouseout="UnTip()" width="50" height="50">&nbsp;
<img src="http://calvano.bplaced.de/bilder/$Data[Tooltip4]onmouseover="Tip('<img src=\'http://calvano.bplaced.de/bilder/$Data[bild4]\' width=\'553\' height=\'367\'>', BORDERWIDTH, 0, BGCOLOR, '')" onmouseout="UnTip()" width="50" height="50">&nbsp;";
    }
    elseif (@mysql_fetch_assoc($pics) = 5) {
        echo "<img src="http://calvano.bplaced.de/bilder/$Data[Tooltip1]onmouseover="Tip('<img src=\'http://calvano.bplaced.de/bilder/$Data[bild1]\' width=\'553\' height=\'367\'>', BORDERWIDTH, 0, BGCOLOR, '')" onmouseout="UnTip()" width="50" height="50">&nbsp;
<img src="http://calvano.bplaced.de/bilder/$Data[Tooltip2]onmouseover="Tip('<img src=\'http://calvano.bplaced.de/bilder/$Data[bild2]\' width=\'553\' height=\'367\'>', BORDERWIDTH, 0, BGCOLOR, '')" onmouseout="UnTip()" width="50" height="50">&nbsp;
<img src="http://calvano.bplaced.de/bilder/$Data[Tooltip3]onmouseover="Tip('<img src=\'http://calvano.bplaced.de/bilder/$Data[bild3]\' width=\'553\' height=\'367\'>', BORDERWIDTH, 0, BGCOLOR, '')" onmouseout="UnTip()" width="50" height="50">&nbsp;
<img src="http://calvano.bplaced.de/bilder/$Data[Tooltip4]onmouseover="Tip('<img src=\'http://calvano.bplaced.de/bilder/$Data[bild4]\' width=\'553\' height=\'367\'>', BORDERWIDTH, 0, BGCOLOR, '')" onmouseout="UnTip()" width="50" height="50">&nbsp;
<img src="http://calvano.bplaced.de/bilder/$Data[Tooltip5]onmouseover="Tip('<img src=\'http://calvano.bplaced.de/bilder/$Data[bild5]\' width=\'553\' height=\'367\'>', BORDERWIDTH, 0, BGCOLOR, '')" onmouseout="UnTip()" width="50" height="50">&nbsp;";
    }
    elseif (@mysql_fetch_assoc($pics) = 6) {
        echo "<img src="http://calvano.bplaced.de/bilder/$Data[Tooltip1]onmouseover="Tip('<img src=\'http://calvano.bplaced.de/bilder/$Data[bild1]\' width=\'553\' height=\'367\'>', BORDERWIDTH, 0, BGCOLOR, '')" onmouseout="UnTip()" width="50" height="50">&nbsp;
<img src="http://calvano.bplaced.de/bilder/$Data[Tooltip2]onmouseover="Tip('<img src=\'http://calvano.bplaced.de/bilder/$Data[bild2]\' width=\'553\' height=\'367\'>', BORDERWIDTH, 0, BGCOLOR, '')" onmouseout="UnTip()" width="50" height="50">&nbsp;
<img src="http://calvano.bplaced.de/bilder/$Data[Tooltip3]onmouseover="Tip('<img src=\'http://calvano.bplaced.de/bilder/$Data[bild3]\' width=\'553\' height=\'367\'>', BORDERWIDTH, 0, BGCOLOR, '')" onmouseout="UnTip()" width="50" height="50">&nbsp;
<img src="http://calvano.bplaced.de/bilder/$Data[Tooltip4]onmouseover="Tip('<img src=\'http://calvano.bplaced.de/bilder/$Data[bild4]\' width=\'553\' height=\'367\'>', BORDERWIDTH, 0, BGCOLOR, '')" onmouseout="UnTip()" width="50" height="50">&nbsp;
<img src="http://calvano.bplaced.de/bilder/$Data[Tooltip5]onmouseover="Tip('<img src=\'http://calvano.bplaced.de/bilder/$Data[bild5]\' width=\'553\' height=\'367\'>', BORDERWIDTH, 0, BGCOLOR, '')" onmouseout="UnTip()" width="50" height="50">&nbsp;
<img src="http://calvano.bplaced.de/bilder/$Data[Tooltip6]onmouseover="Tip('<img src=\'http://calvano.bplaced.de/bilder/$Data[bild6]\' width=\'553\' height=\'367\'>', BORDERWIDTH, 0, BGCOLOR, '')" onmouseout="UnTip()" width="50" height="50">&nbsp;";
    }
    elseif (@mysql_fetch_assoc($pics) = 7) {
        echo "<img src="http://calvano.bplaced.de/bilder/$Data[Tooltip1]onmouseover="Tip('<img src=\'http://calvano.bplaced.de/bilder/$Data[bild1]\' width=\'553\' height=\'367\'>', BORDERWIDTH, 0, BGCOLOR, '')" onmouseout="UnTip()" width="50" height="50">&nbsp;
<img src="http://calvano.bplaced.de/bilder/$Data[Tooltip2]onmouseover="Tip('<img src=\'http://calvano.bplaced.de/bilder/$Data[bild2]\' width=\'553\' height=\'367\'>', BORDERWIDTH, 0, BGCOLOR, '')" onmouseout="UnTip()" width="50" height="50">&nbsp;
<img src="http://calvano.bplaced.de/bilder/$Data[Tooltip3]onmouseover="Tip('<img src=\'http://calvano.bplaced.de/bilder/$Data[bild3]\' width=\'553\' height=\'367\'>', BORDERWIDTH, 0, BGCOLOR, '')" onmouseout="UnTip()" width="50" height="50">&nbsp;
<img src="http://calvano.bplaced.de/bilder/$Data[Tooltip4]onmouseover="Tip('<img src=\'http://calvano.bplaced.de/bilder/$Data[bild4]\' width=\'553\' height=\'367\'>', BORDERWIDTH, 0, BGCOLOR, '')" onmouseout="UnTip()" width="50" height="50">&nbsp;
<img src="http://calvano.bplaced.de/bilder/$Data[Tooltip5]onmouseover="Tip('<img src=\'http://calvano.bplaced.de/bilder/$Data[bild5]\' width=\'553\' height=\'367\'>', BORDERWIDTH, 0, BGCOLOR, '')" onmouseout="UnTip()" width="50" height="50">&nbsp;
<img src="http://calvano.bplaced.de/bilder/$Data[Tooltip6]onmouseover="Tip('<img src=\'http://calvano.bplaced.de/bilder/$Data[bild6]\' width=\'553\' height=\'367\'>', BORDERWIDTH, 0, BGCOLOR, '')" onmouseout="UnTip()" width="50" height="50">&nbsp;
<img src="http://calvano.bplaced.de/bilder/$Data[Tooltip7]onmouseover="Tip('<img src=\'http://calvano.bplaced.de/bilder/$Data[bild7]\' width=\'553\' height=\'367\'>', BORDERWIDTH, 0, BGCOLOR, '')" onmouseout="UnTip()" width="50" height="50">";
    }
    else {
        echo "Keine Bilder vorhanden";
    }
?>



Geschrieben von MissFreaky am 26.12.2009 um 19:54:

 

Die Fehlermeldung ist weg großes Grinsen
Aber jetzt wird das angezeigt was bei else steht also das keine Bilder vorhanden sind: http://calvano.bplaced.de/pony.php?id=1



Geschrieben von MissFreaky am 26.12.2009 um 20:15:

 

Geht leider immer noch nicht >.<
Der komplette Code sieht so aus.

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:
225:
226:
227:
228:
229:
230:
231:
232:
233:
234:
235:
236:
237:
238:
239:
240:
241:
242:
243:
244:
245:
246:
247:
248:
249:
250:
251:
252:
253:
254:
255:
256:
257:
258:
259:
260:
261:
262:
263:
264:
265:
266:
267:
268:
269:
270:
271:
272:
273:
274:
275:
276:
277:
278:
279:
280:
281:
282:
283:
284:
285:
286:
287:
288:
289:
290:
291:
292:
293:
294:
295:
296:
297:
298:
299:
300:
301:
302:
303:
304:
305:
306:
307:
308:
309:
310:
311:
312:
313:
314:
315:
316:
317:
318:
319:
320:
321:
322:
323:
324:
325:
326:
327:
328:
329:
330:
331:
332:
333:
334:
335:
336:
337:
338:
339:
340:
341:
342:
343:
344:
345:
346:
347:
348:
349:
350:
351:
352:
353:
354:
355:
356:
357:
358:
359:
360:
361:
362:
363:
364:
365:
366:
367:
368:
369:
370:
371:
372:
373:
374:
375:
376:
377:
378:
379:
380:
381:
382:
383:
384:
385:
386:
387:
388:
389:
390:
391:
392:
393:
394:
395:

<html>

<head>
<meta http-equiv="Content-Language" content="de">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>Neue Seite 1</title>
<link rel="stylesheet" href="http://calvano.bplaced.de/main.css">
</head>

<body>
<script type="text/javascript" src="http://calvano.bplaced.de/wz_tooltip.js"></script>
<center>


<?php

// Verbindung zur Datenbank
include("db.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 "


<p class="head" align="left">$Data[name]</p>

<p style="margin-top3margin-bottom3" align="left">&nbsp;</p>
<div align="center">
<table class="tablea" border="0" width="450" cellspacing="0" cellpadding="5">
  <tr>
    <td class="neu" width="430" colspan="4">
      <p align="center"><b>$Data[name]</b></p>
    </td>
  </tr>
  <tr>
    <td class="tdb" width="173" colspan="2">

      <p align="center"><img border="0" src="http://calvano.bplaced.de/bilder/$Data[vorschaupic]" align="center"></td>
    <td class="tdd" width="257" colspan="2">
      <table border="0" width="100%">
        <tr>
          <td width="50%"><font size="1">ID</font></td>
          <td width="50%"><font size="1">$Data[ID]</font></td>
        </tr>
        <tr>

          <td width="50%"><font size="1">Alter</font></td>
          <td width="50%"><font size="1">$Data[alter]</font></td>
        </tr>
        <tr>
          <td width="50%"><font size="1">Rasse</font></td>
          <td width="50%"><font size="1">$Data[rasse]</font></td>

        </tr>
        <tr>
          <td width="50%"><font size="1">Geschlecht</font></td>
          <td width="50%"><font size="1">$Data[geschlecht]</font></td>
        </tr>
        <tr>
          <td width="50%"><font size="1">Stockmaß</font></td>

          <td width="50%"><font size="1">$Data[stockmaß]</font></td>
        </tr>
        <tr>
          <td width="50%"><font size="1">Wert</font></td>
          <td width="50%"><font size="1">$Data[wert</font></td>
        </tr>
        <tr>

          <td width="50%"><font size="1">Besitzer</font></td>
          <td width="50%"><font size="1">$Data[besitzer]</font></td>
        </tr>
      </table>
    </td>
  </tr>
  <tr>
    <td class="tdd" width="430" colspan="4">

      <p align="center"><font size="1">Danke an <a href="$Data[copyrightaddy]target="_blank"><font color="#FFFFFF">$Data[copyright]</font></afür die Bilder !</font></td>
  </tr>
  <tr>
    <td class="neu" width="430" colspan="4" align="center">Charakter und Verhalten</td>
  </tr>
  <tr>

    <td class="tda" width="430" colspan="4" align="center">Charakter</td>
  </tr>
  <tr>
    <td class="tdd" width="430" colspan="4"><font size="1">$Data[charakter]</font></td>
  </tr>
  <tr>
    <td class="tda" width="220" align="center" colspan="2">

      <p align="center"><font size="1"><b>V</b>erladefromm</font></td>
    <td class="tdb" width="210" align="left" colspan="2">
      <p align="left"><img border="0" src="http://calvano.bplaced.de/Graphiken Button/stats$Data[verladefromm].gif"></td>
  </tr>
  <tr>
    <td class="tda" width="220" align="center" colspan="2"><font size="1"><b>S</b>chmiedefromm</font></td>
    <td class="tdb" width="210" align="left" colspan="2"><img border="0" src="http://calvano.bplaced.de/Graphiken Button/stats$Data[schmiedefromm].gif"></td>

  </tr>
  <tr>
    <td class="tda" width="220" align="center" colspan="2"><font size="1"><b>U</b>mgang</font></td>
    <td class="tdb" width="210" align="left" colspan="2"><img border="0" src="http://calvano.bplaced.de/Graphiken Button/stats$Data[umgang].gif"></td>
  </tr>
  <tr>
    <td class="tda" width="220" align="center" colspan="2"><font size="1"><b>S</b>chreckhaftigkeit</font></td>

    <td class="tdb" width="210" align="left" colspan="2"><img border="0" src="http://calvano.bplaced.de/Graphiken Button/stats$Data[schreckhaftigkeit].gif"></td>
  </tr>
  <tr>
    <td class="neu" width="430" colspan="4">
      <p align="center">Fotoalbum</p>
    </td>
  </tr>
  <tr>

    <td class="tdd" width="430" align="center" colspan="4">


";
}
?>

<?php
   include('db.php');
$id = "$_GET[id]";


$pics = mysql_query( "SELECT anzahl FROM pferd where ID='$id'" );
if (@mysql_fetch_assoc($pics) == 1) {
        echo "<img src="http://calvano.bplaced.de/bilder/$Data[Tooltip1]onmouseover="Tip('<img src=\'http://calvano.bplaced.de/bilder/$Data[bild1]\' width=\'553\' height=\'367\'>', BORDERWIDTH, 0, BGCOLOR, '')" onmouseout="UnTip()" width="50" height="50">&nbsp;";
    }
    elseif (@mysql_fetch_assoc($pics) == 2) {
        echo "<img src="http://calvano.bplaced.de/bilder/$Data[Tooltip1]onmouseover="Tip('<img src=\'http://calvano.bplaced.de/bilder/$Data[bild1]\' width=\'553\' height=\'367\'>', BORDERWIDTH, 0, BGCOLOR, '')" onmouseout="UnTip()" width="50" height="50">&nbsp;
<img src="http://calvano.bplaced.de/bilder/$Data[Tooltip2]onmouseover="Tip('<img src=\'http://calvano.bplaced.de/bilder/$Data[bild2]\' width=\'553\' height=\'367\'>', BORDERWIDTH, 0, BGCOLOR, '')" onmouseout="UnTip()" width="50" height="50">&nbsp;";
    }
    elseif (@mysql_fetch_assoc($pics) == 3) {
        echo "<img src="http://calvano.bplaced.de/bilder/$Data[Tooltip1]onmouseover="Tip('<img src=\'http://calvano.bplaced.de/bilder/$Data[bild1]\' width=\'553\' height=\'367\'>', BORDERWIDTH, 0, BGCOLOR, '')" onmouseout="UnTip()" width="50" height="50">&nbsp;
<img src="http://calvano.bplaced.de/bilder/$Data[Tooltip2]onmouseover="Tip('<img src=\'http://calvano.bplaced.de/bilder/$Data[bild2]\' width=\'553\' height=\'367\'>', BORDERWIDTH, 0, BGCOLOR, '')" onmouseout="UnTip()" width="50" height="50">&nbsp;<img src="http://calvano.bplaced.de/bilder/$Data[Tooltip3]onmouseover="Tip('<img src=\'http://calvano.bplaced.de/bilder/$Data[bild3]\' width=\'553\' height=\'367\'>', BORDERWIDTH, 0, BGCOLOR, '')" onmouseout="UnTip()" width="50" height="50">&nbsp;";
    }
    elseif (@mysql_fetch_assoc($pics) == 4) {
        echo "<img src="http://calvano.bplaced.de/bilder/$Data[Tooltip1]onmouseover="Tip('<img src=\'http://calvano.bplaced.de/bilder/$Data[bild1]\' width=\'553\' height=\'367\'>', BORDERWIDTH, 0, BGCOLOR, '')" onmouseout="UnTip()" width="50" height="50">&nbsp;
<img src="http://calvano.bplaced.de/bilder/$Data[Tooltip2]onmouseover="Tip('<img src=\'http://calvano.bplaced.de/bilder/$Data[bild2]\' width=\'553\' height=\'367\'>', BORDERWIDTH, 0, BGCOLOR, '')" onmouseout="UnTip()" width="50" height="50">&nbsp;
<img src="http://calvano.bplaced.de/bilder/$Data[Tooltip3]onmouseover="Tip('<img src=\'http://calvano.bplaced.de/bilder/$Data[bild3]\' width=\'553\' height=\'367\'>', BORDERWIDTH, 0, BGCOLOR, '')" onmouseout="UnTip()" width="50" height="50">&nbsp;
<img src="http://calvano.bplaced.de/bilder/$Data[Tooltip4]onmouseover="Tip('<img src=\'http://calvano.bplaced.de/bilder/$Data[bild4]\' width=\'553\' height=\'367\'>', BORDERWIDTH, 0, BGCOLOR, '')" onmouseout="UnTip()" width="50" height="50">&nbsp;";
    }
    elseif (@mysql_fetch_assoc($pics) == 5) {
        echo "<img src="http://calvano.bplaced.de/bilder/$Data[Tooltip1]onmouseover="Tip('<img src=\'http://calvano.bplaced.de/bilder/$Data[bild1]\' width=\'553\' height=\'367\'>', BORDERWIDTH, 0, BGCOLOR, '')" onmouseout="UnTip()" width="50" height="50">&nbsp;
<img src="http://calvano.bplaced.de/bilder/$Data[Tooltip2]onmouseover="Tip('<img src=\'http://calvano.bplaced.de/bilder/$Data[bild2]\' width=\'553\' height=\'367\'>', BORDERWIDTH, 0, BGCOLOR, '')" onmouseout="UnTip()" width="50" height="50">&nbsp;
<img src="http://calvano.bplaced.de/bilder/$Data[Tooltip3]onmouseover="Tip('<img src=\'http://calvano.bplaced.de/bilder/$Data[bild3]\' width=\'553\' height=\'367\'>', BORDERWIDTH, 0, BGCOLOR, '')" onmouseout="UnTip()" width="50" height="50">&nbsp;
<img src="http://calvano.bplaced.de/bilder/$Data[Tooltip4]onmouseover="Tip('<img src=\'http://calvano.bplaced.de/bilder/$Data[bild4]\' width=\'553\' height=\'367\'>', BORDERWIDTH, 0, BGCOLOR, '')" onmouseout="UnTip()" width="50" height="50">&nbsp;
<img src="http://calvano.bplaced.de/bilder/$Data[Tooltip5]onmouseover="Tip('<img src=\'http://calvano.bplaced.de/bilder/$Data[bild5]\' width=\'553\' height=\'367\'>', BORDERWIDTH, 0, BGCOLOR, '')" onmouseout="UnTip()" width="50" height="50">&nbsp;";
    }
    elseif (@mysql_fetch_assoc($pics) == 6) {
        echo "<img src="http://calvano.bplaced.de/bilder/$Data[Tooltip1]onmouseover="Tip('<img src=\'http://calvano.bplaced.de/bilder/$Data[bild1]\' width=\'553\' height=\'367\'>', BORDERWIDTH, 0, BGCOLOR, '')" onmouseout="UnTip()" width="50" height="50">&nbsp;
<img src="http://calvano.bplaced.de/bilder/$Data[Tooltip2]onmouseover="Tip('<img src=\'http://calvano.bplaced.de/bilder/$Data[bild2]\' width=\'553\' height=\'367\'>', BORDERWIDTH, 0, BGCOLOR, '')" onmouseout="UnTip()" width="50" height="50">&nbsp;
<img src="http://calvano.bplaced.de/bilder/$Data[Tooltip3]onmouseover="Tip('<img src=\'http://calvano.bplaced.de/bilder/$Data[bild3]\' width=\'553\' height=\'367\'>', BORDERWIDTH, 0, BGCOLOR, '')" onmouseout="UnTip()" width="50" height="50">&nbsp;
<img src="http://calvano.bplaced.de/bilder/$Data[Tooltip4]onmouseover="Tip('<img src=\'http://calvano.bplaced.de/bilder/$Data[bild4]\' width=\'553\' height=\'367\'>', BORDERWIDTH, 0, BGCOLOR, '')" onmouseout="UnTip()" width="50" height="50">&nbsp;
<img src="http://calvano.bplaced.de/bilder/$Data[Tooltip5]onmouseover="Tip('<img src=\'http://calvano.bplaced.de/bilder/$Data[bild5]\' width=\'553\' height=\'367\'>', BORDERWIDTH, 0, BGCOLOR, '')" onmouseout="UnTip()" width="50" height="50">&nbsp;
<img src="http://calvano.bplaced.de/bilder/$Data[Tooltip6]onmouseover="Tip('<img src=\'http://calvano.bplaced.de/bilder/$Data[bild6]\' width=\'553\' height=\'367\'>', BORDERWIDTH, 0, BGCOLOR, '')" onmouseout="UnTip()" width="50" height="50">&nbsp;";
    }
    elseif (@mysql_fetch_assoc($pics) == 7) {
        echo "<img src="http://calvano.bplaced.de/bilder/$Data[Tooltip1]onmouseover="Tip('<img src=\'http://calvano.bplaced.de/bilder/$Data[bild1]\' width=\'553\' height=\'367\'>', BORDERWIDTH, 0, BGCOLOR, '')" onmouseout="UnTip()" width="50" height="50">&nbsp;
<img src="http://calvano.bplaced.de/bilder/$Data[Tooltip2]onmouseover="Tip('<img src=\'http://calvano.bplaced.de/bilder/$Data[bild2]\' width=\'553\' height=\'367\'>', BORDERWIDTH, 0, BGCOLOR, '')" onmouseout="UnTip()" width="50" height="50">&nbsp;
<img src="http://calvano.bplaced.de/bilder/$Data[Tooltip3]onmouseover="Tip('<img src=\'http://calvano.bplaced.de/bilder/$Data[bild3]\' width=\'553\' height=\'367\'>', BORDERWIDTH, 0, BGCOLOR, '')" onmouseout="UnTip()" width="50" height="50">&nbsp;
<img src="http://calvano.bplaced.de/bilder/$Data[Tooltip4]onmouseover="Tip('<img src=\'http://calvano.bplaced.de/bilder/$Data[bild4]\' width=\'553\' height=\'367\'>', BORDERWIDTH, 0, BGCOLOR, '')" onmouseout="UnTip()" width="50" height="50">&nbsp;
<img src="http://calvano.bplaced.de/bilder/$Data[Tooltip5]onmouseover="Tip('<img src=\'http://calvano.bplaced.de/bilder/$Data[bild5]\' width=\'553\' height=\'367\'>', BORDERWIDTH, 0, BGCOLOR, '')" onmouseout="UnTip()" width="50" height="50">&nbsp;
<img src="http://calvano.bplaced.de/bilder/$Data[Tooltip6]onmouseover="Tip('<img src=\'http://calvano.bplaced.de/bilder/$Data[bild6]\' width=\'553\' height=\'367\'>', BORDERWIDTH, 0, BGCOLOR, '')" onmouseout="UnTip()" width="50" height="50">&nbsp;
<img src="http://calvano.bplaced.de/bilder/$Data[Tooltip7]onmouseover="Tip('<img src=\'http://calvano.bplaced.de/bilder/$Data[bild7]\' width=\'553\' height=\'367\'>', BORDERWIDTH, 0, BGCOLOR, '')" onmouseout="UnTip()" width="50" height="50">";
    }
    else {
        echo "Keine Bilder vorhanden";
    }
mysql_error(); 
?>


<?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 "




    </td>
  </tr>

  <tr>
    <td class="neu" width="430" colspan="4">
      <p align="center">Ausbildung</p>
    </td>
  </tr>

  <tr>
    <td class="tdd" width="430" colspan="4">
      <table border="0" width="100%">

        <tr>
          <td width="33%" align="center">Dressur</td>
          <td width="33%" align="center">Springen</td>
          <td width="34%" align="center">Vielseitigkeit</td>
        </tr>
      </table>
    </td>

  </tr>

  <tr>
    <td class="tdd" width="430" colspan="4">
      <table border="0" width="100%">
        <tr>
          <td width="33%">


<p align="center" style="margin-top: -2; margin-bottom: -2"><img border="0" src="http://calvano.bplaced.de/Graphiken Button/Ausb$Data[Dressurausbildung].png" width="105" height="18"></p>
<p align="center" style="margin-top: -2; margin-bottom: -2"><font size="1">Ausbildung</font></p>

<p align="center" style="margin-top: -2; margin-bottom: -2">&nbsp;</p>
<p align="center" style="margin-top: -2; margin-bottom: -2"><img border="0" src="http://calvano.bplaced.de/Graphiken Button/Ausb$Data[Dressurpotenzial].png" width="105" height="18"></p>
<p align="center" style="margin-top: -2; margin-bottom: -2"><font size="1">Potenzial</font></p>


          </td>
          <td width="33%">


<p align="center" style="margin-top: -2; margin-bottom: -2"><img border="0" src="http://calvano.bplaced.de/Graphiken Button/Ausb$Data[Springausbildung].png" width="105" height="18"></p>
<p align="center" style="margin-top: -2; margin-bottom: -2"><font size="1">Ausbildung</font></p>
<p align="center" style="margin-top: -2; margin-bottom: -2">&nbsp;</p>
<p align="center" style="margin-top: -2; margin-bottom: -2"><img border="0" src="http://calvano.bplaced.de/Graphiken Button/Ausb$Data[Springpotenzial].png" width="105" height="18"></p>
<p align="center" style="margin-top: -2; margin-bottom: -2"><font size="1">Potenzial</font></p>


          </td>
          <td width="34%">


<p align="center" style="margin-top: -2; margin-bottom: -2"><img border="0" src="http://calvano.bplaced.de/Graphiken Button/Ausb$Data[VSausbildung].png" width="105" height="18"></p>
<p align="center" style="margin-top: -2; margin-bottom: -2"><font size="1">Ausbildung</font></p>
<p align="center" style="margin-top: -2; margin-bottom: -2">&nbsp;</p>
<p align="center" style="margin-top: -2; margin-bottom: -2"><img border="0" src="http://calvano.bplaced.de/Graphiken Button/Ausb$Data[VSpotenzial].png" width="105" height="18"></p>
<p align="center" style="margin-top: -2; margin-bottom: -2"><font size="1">Potenzial</font></p>


          </td>
        </tr>
      </table>
    </td>
  </tr>

  <tr>
    <td class="tda" width="215" colspan="2">Western</td>

    <td class="tdb" width="215" colspan="2">$Data[western]</td>
  </tr>

  <tr>
    <td class="tda" width="215" colspan="2">Fahren</td>
    <td class="tdb" width="215" colspan="2">$Data[fahren]</td>
  </tr>

  <tr>
    <td class="neu" width="430" colspan="4">
      <p align="center">Stammbaum und Zuchtinfos</td>
  </tr>

  <tr>
    <td class="tdd" width="430" colspan="4">
      <table border="0" width="100%">
        <tr>

          <td width="34%" rowspan="4" align="center"><font size="1">$Data[name]</font></td>
          <td width="33%" rowspan="2" align="center"><font size="1">$Data[Vater]</font></td>
          <td width="33%" align="center"><font size="1">$Data[VatervonVater]</font></td>
        </tr>
        <tr>
          <td width="33%" align="center"><font size="1">$Data[MuttervonVater]</font></td>
        </tr>

        <tr>
          <td width="33%" rowspan="2" align="center"><font size="1">$Data[Mutter]</font></td>
          <td width="33%" align="center"><font size="1">$Data[VatervonMutter]</font></td>
        </tr>
        <tr>
          <td width="33%" align="center"><font size="1">$Data[MuttervonMutter]</font></td>
        </tr>

      </table>
    </td>
  </tr>

  <tr>
    <td class="tda" width="108" align="left">Zuchtzulassung</td>
    <td class="tdb" width="108" align="left"><img border="0" src="http://calvano.bplaced.de/Graphiken Button/$Data[Zuchtzulassung].gif" width="15" height="15"></td>
    <td class="tda" width="107" align="left">Decktaxe</td>

    <td class="tdb" width="107" align="left">$Data[Decktaxe</td>
  </tr>

  <tr>
    <td class="tda" width="108" align="left">
      <p align="left">Nachkommen</p>
    </td>
    <td class="tdb" width="108" align="left">

      <p align="left">$Data[Nachkommen]</td>
    <td class="tda" width="107" align="left">Status</td>
    <td class="tdb" width="107" align="left">$Data[Status]</td>
  </tr>

  <tr>
    <td class="neu" width="430" colspan="4">
      <p align="center">Sonstiges</p>

    </td>
  </tr>

  <tr>
    <td class="tdd" width="215" colspan="2">Gesundheit und Wohlbefinden</td>
    <td class="tdd" width="215" colspan="2"><img border="0" src="http://calvano.bplaced.de/Graphiken Button/PixelProzent$Data[Gesundheit].png"></td>
  </tr>

  <tr>

    <td class="tdd" width="215" colspan="2">Stall</td>
    <td class="tdd" width="215" colspan="2">$Data[Stall]</td>
  </tr>

  <tr>
    <td class="tdd" width="215" colspan="2">Futterplan</td>
    <td class="tdd" width="215" colspan="2">$Data[Futterplan]</td>

  </tr>

  <tr>
    <td class="tdd" width="215" colspan="2">Pfleger</td>
    <td class="tdd" width="215" colspan="2">$Data[Pfleger]</td>
  </tr>


  <tr>
    <td class="tda" width="430" colspan="4" align="center">Erfolge und Auszeichnungen</td>

  </tr>


  <tr>
    <td class="tdb" width="430" colspan="4" align="center">$Data[Erfolge]</td>
  </tr>
</table>

</div>
<br>

";
}
?>


</center>
</body>
</html>


Auch wenn ich Tooltip 1-7 und Bild 1-7 nochmal abfrage ändert sich nichts ... Bin schon am verzweifeln unglücklich



Geschrieben von MissFreaky am 26.12.2009 um 21:29:

 

Doch sind doppelt und geht nicht .__.



Geschrieben von Stelo am 26.12.2009 um 22:02:

 

Was genau geht denn nicht? Oder was wird angezeigt, und was nicht?
php:
1:
$pics mysql_query"SELECT anzahl FROM pferd where ID='$id'" ) OR die(mysql_error());

Diese Jugend von heute, was müssen auch imemr alle die Fehlermeldungen unterdrücken. Augen rollen Revolution! cool



Geschrieben von MissFreaky am 26.12.2009 um 22:09:

 

Habs eingefügt. Aber es kommt kein Fehler. Es wird das angezeigt was bei "else" steht. Siehe hier

Hatte auch diesen Code versucht:

php:
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:

<?php
  $pics mysql_query"SELECT anzahl FROM pferd where ID='$id'" )
    or die("MySQL-Fehler: " mysql_error());
 
 
  $anzahl = @mysql_num_rows($pics);
 
  for ($i 1$i <= $anzahl$i++)
    echo "<img src="http://calvano.bplaced.de/bilder/" . $Data['Tooltip' . $i] . "" 
               onmouseover="Tip('<img src=\'http://calvano.bplaced.de/bilder/" $Data['bild' $i] . "\' width=\'553\' height=\'367\'>', BORDERWIDTH, 0, BGCOLOR, '')" 
               onmouseout="UnTip()" width="50" height="50">&nbsp;"; 
?> 


Dort wird aber wieder nur ein Tooltip angezeigt: klick hier



Geschrieben von Stelo am 26.12.2009 um 22:11:

 

Na ja, wenn eins angezeigt wird, ist das doch schon mal nicht schlecht.

Aber auch bei dem zweiten Code hier benutzt du mysql_num_rows, du willst aber nicht die Einträge zählen (denn das ist nur einer), sondern das Feld anzahl auslesen lassen. Und wie das geht, wurde dir ein Stück weiter oben ja bereits mitgeteilt. smile

EDIT: Argh, ich hab das Problem gefunden, wie doof von uns. xD

php:
1:
2:
$row mysql_fetch_assoc($pics); 
$anzahl $row['anzahl'];


Man muss natürlich aus dem Array auch noch das entsprechende Feld auslesen, sorry.



Geschrieben von MissFreaky am 26.12.2009 um 22:24:

 

So richtig eingefügt? Weil jetzt kommt nix mehr kliicken
php:
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:

<?php
  $pics mysql_query"SELECT anzahl FROM pferd where ID='$id'" )
    or die("MySQL-Fehler: " mysql_error());
 
 
$row mysql_fetch_assoc($pics); 
$anzahl $row['anzahl'];
 
  for ($i 1$i <= $anzahl$i++)
    echo "<img src="http://calvano.bplaced.de/bilder/" . $Data['Tooltip' . $i] . "" 
               onmouseover="Tip('<img src=\'http://calvano.bplaced.de/bilder/" $Data['bild' $i] . "\' width=\'553\' height=\'367\'>', BORDERWIDTH, 0, BGCOLOR, '')" 
               onmouseout="UnTip()" width="50" height="50">&nbsp;"; 
?> 



Geschrieben von Stelo am 26.12.2009 um 22:27:

 

Kannst du mal irgendwo
php:
1:
echo $anzahl;
machen? Mal gucken was da raus kommt. Find ich ja jetzt seltsam ...



Geschrieben von MissFreaky am 26.12.2009 um 22:33:

 

0 verwirrt

http://calvano.bplaced.de/pferd.php?id=1

Langsam zweifel ich daran das es ne Lösung dafür gibt xD



Geschrieben von Stelo am 26.12.2009 um 22:39:

 

Und was kommt raus, wenn du diese SQL-Abfrage mal bei phpmyadmin angibst? Und bist du sicher, dass bei anzahl auch nicht null drin steht?

code:
1:
SELECT anzahl FROM pferd WHERE ID=1


Forensoftware: Burning Board, entwickelt von WoltLab GmbH