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] PHP-Problem... (https://www.gegen-bilderklau.net/thread.php?threadid=152952)


Geschrieben von pferdenarre am 31.03.2009 um 22:38:

  PHP-Problem...

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/Verkaufsstall/pferde/berichte.php?id=6


LG und danke im Vorraus
Jenni



Geschrieben von 1Sm!le am 01.04.2009 um 00:19:

 

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



Geschrieben von pferdenarre am 01.04.2009 um 15:12:

 

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.



Geschrieben von .Senseless am 01.04.2009 um 15:31:

 

In der Zeile 52 kommt doch vor 'id' noch ein $, also '$id'?



Geschrieben von pferdenarre am 01.04.2009 um 16:33:

 

Is ja nich wahr!
Das geht O.o

Du bist toll dankeschööön <33 fröhlich



Geschrieben von .Senseless am 01.04.2009 um 17:10:

 

Freut mich, dass es geht großes Grinsen

Bitteschön^^



Geschrieben von pferdenarre am 02.04.2009 um 17:35:

 

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^^



Geschrieben von .Senseless am 02.04.2009 um 17:44:

 

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



Geschrieben von pferdenarre am 02.04.2009 um 18:02:

 

Wow das funktioniert^^

Ich bin dir echt was schuldig, danke^^


Forensoftware: Burning Board, entwickelt von WoltLab GmbH