tut mir leid, abe ich hab immer noch ein Problem

Sebastian Wramba

Erfahrenes Mitglied
...und zwar wird diese for-Schleife zigtausen mal wiederholt, obwohl nur ein Eintrag vorhanden ist: den Code davor und dahinter hab ich auch gleich mal mitgepostet

PHP:
<?php
include("connect.php");


//Abfrage der relevanten Daten
$strSQL = "SELECT ID,gegner,kurz,URL,playerhome,playerout,maphome,mapout,roundtime,termin,time,server,ergmaphomehome,ergmaphomeout,ergmapouthome,ergmapoutout FROM WJ_cscwp ORDER BY ID DESC";
$hErgebnis = @mysql_query($strSQL)
or die("Abfrage $strSQL ist Fehlgeschlagen <br> \n " .
mysql_errno() . ":" . mysql_error());


echo "<body bgcolor= " .$bodybg . " alink=\"" . $linkcol . "\" link=\"" . $linkcol . "\" vlink=\"" . $linkcol . "\">";

echo "<link rel=\"stylesheet\" href=\"http://kfd.strikenet.de/bg.css\" type=\"text/css\">";
echo "<link rel=\"stylesheet\" href=\"http://kfd.strikenet.de/links.css\" type=\"text/css\">";

?>

<script language="JavaScript">
   function fightus() {
     window.open('http://www.kfd-clan.f2s.com/clanwar/fightus.php',
                 'FightUs','width=380, height=280,resizable=no');
   }
</script>

<?php

if (mysql_num_rows($hErgebnis)) 
{

echo "<center> \n <table border=\"" . $aborder . "\" bgcolor=\"" . $atblcol . "\" bordercolor=\"" . $abordcol . "\" width=\"80%\" cellspacing=\"0\"> \n <tr> \n <td> \n <center> \n <font color=\"" . $afont . "\"> \n <h2> \n <b> \n " . $homeclan . "</h2> \n </b> \n </font> \n";
echo "<p> \n <font face=\"" . $fontface . "\" color=\"" . $fonti . "\" size=\"" . $fontsize . "\"> \n Warplaner </font> \n </center> \n </td> \n </tr> \n ";
echo "<tr> \n <td> \n <center> \n <font face=\"" . $fontface . "\" color=\"" . $fonti . "\" size=\"" . $fontsize . "\"> <a href=\"javascript:fightus()\"> \n SIGN IN FOR CW </a> \n </center> \n </td> \n </tr>\n";
echo "<tr> \n <td> \n <table border=\"1\" bgcolor=" .$itablecolor . " bordercolor=$ibordercolor width=\"100%\"> \n ";
while($oZeile = mysql_fetch_array($hErgebnis))

{

for($i = 0; $i < 100; $i ++ ) {
echo "<tr> \n <td width=\"20%\" valign=\"top\"> \n";
echo "<font face=\"" . $fontface . "\" color=\"" . $fonti . "\" size=\"" . $fontsize . "\"> \n";
echo "<a href=\"http://";
echo $oZeile["URL"];
echo "\"> \n <b> \n ";
echo $oZeile["gegner"];
echo " </b> </a>";
echo "<p> \n VS <p> \n";
echo "<b> \n";
echo $homeclan;
echo "</b> \n";
echo "<p> \n";
echo $oZeile["termin"];
echo "<br> \n";
echo $oZeile["time"];
echo "</font> \n";
echo "</td> \n <td valign=\"top\"> \n";
echo "<font face=\"" . $fontface . "\" color=\"" . $fonti . "\" size=\"" . $fontsize . "\"> \n";
echo "ServerIP:";
echo $oZeile["server"];
echo "<p> \n";
echo "roundtime:";
echo $oZeile["roundtime"];
echo "<p> \n";
echo "Spieler ";
echo $oZeile["kurz"];
echo ":";
echo $oZeile["playerout"];
echo "<p> \n";
echo "Spieler ";
echo $homekurz;
echo ":";
echo $oZeile["playerhome"];
echo "</font> \n </td> \n <td width=\"20%\" valign=\"top\"> \n ";
echo "<font face=\"" . $fontface . "\" color=\"" . $fonti . "\" size=\"" . $fontsize . "\"> \n";
echo "Map ";
echo $oZeile["kurz"];
echo ":";
echo $oZeile["mapout"];
echo "<p> \n";
echo "Map ";
echo $homekurz;
echo ":";
echo $oZeile["maphome"];
echo "</font> \n";
echo "</td> \n </tr> \n <tr> \n <td> \ </td> \n <td> \n";
echo "<center> \n <<font face=\"" . $fontface . "\" color=\"" . $fonti . "\" size=\"4\"> \n ERGEBNISSE </font> \n </center> \n <p> \n";
echo "<font face=\"" . $fontface . "\" color=\"" . $fonti . "\" size=\"" . $fontsize . "\"> \n";
echo "<u> \n <b> \n ";
echo $oZeile["mapout"];
echo "</u> \n </b> \n ";
echo "<br> \n <br> \n";
echo $oZeile["kurz"];
echo " : ";
echo $oZeile["ergmapoutout"];
echo "&nbsp; &nbsp; &nbsp;";
echo $homekurz;
echo " : ";
echo $oZeile["ergmapouthome"];
echo "<br> \n <hr> \n <br> \n";
echo "<u> \n <b> \n ";
echo $oZeile["maphome"];
echo "</u> \n </b> \n ";
echo "<br> \n <br> \n";
echo $oZeile["kurz"];
echo " : ";
echo $oZeile["ergmaphomeout"];
echo "&nbsp; &nbsp; &nbsp;";
echo $homekurz;
echo " : ";
echo $oZeile["ergmaphomehome"];
echo "</td> \n <td> \n &nbsp; </td> \n ";
echo "</tr> \n";
echo "<tr> \n <td bgcolor=\"" . $trenn . "\"> \n &nbsp; </td> \n <td bgcolor=\"" . $trenn . "\"> \n &nbsp; </td> \n <td bgcolor=\"" . $trenn . "\"> \n &nbsp; </td> \n </tr> \n";
};


}

echo "</table> \n </tr> \n <tr> \n <td border=\"" . $aborder . "\" bgcolor=\"#006699\"> \n ";
echo "<center> \n <font face=\"" . $fontface . "\" color=\"" . $fonti . "\" size=\"" . $fontsize . "\"><a href=\"javascript:fightus()\"> \n SIGN IN FOR CW </a> \n </p> \n ";
echo "</center> \n </td> \n </tr> \n";
echo "<tr> \n <td> \n <a href=\"copy.php\"> \n <center> \n copyrights </center> \n </a> \n ";
echo "</td> \n </tr> \n";
echo "</table> \n  ";

}
else
{
echo "<center> \n";
echo "<font face=\"" . $fontface . "\" color=\"" . $fonti . "\" size=\"" . $fontsize . "\"> \n Es gibt leider noch keine Einträge.";
echo "<p> \n";
echo "<a href=\"javascript:fightus()\"> \n SIGN IN FOR CW </a> \n </p> \n ";
echo "</font> \n </center> \n";
}
?>

Es tut mir leid, dass ich allen hier so auf die Nerven gehe aber sonst wüsste ich keinen, den ich fragen könnte. :)
 
Also nur zur Erklärung. Ich hab das Script nicht selber geschrieben, also weiß ich auch nicht genau, was was bedeuten soll.

Also was bedeutet:

PHP:
$i=0

was bedeutet dahinter:

PHP:
$i<100

und das Problem hab ich jetzt gelöst:

PHP:
for($i = 0; $i < mysql_num_rows($hErgebnis); $i ++ )

Diese Zeile interpretier ich so:

PHP:
$i=0
, weiß ich nicht. Und für jedes Mal das
PHP:
mysql_num_rows($hErgebnis)
zutrifft wird soundso gemacht. Was heißt nun
PHP:
$i ++
?

Sorry für das Durcheinander. :)

[edit]warum schreibt der die ****** zahlen da nich hinter??[/edit] aber ihr wisst ja was gemeint ist. :)
 
Zuletzt bearbeitet:
Was heißt wie weit zählen soll?

Ich hab einen parse error in line 2 bei ner anderen Datei line 2 sieht so aus:

PHP:
echo "<body bgcolor=\"" . $bodybg "\"> \n ";
 
Vielleicht war dies auch Zeile 2, denn daran hat's nicht gelegen:

PHP:
echo "<font face=\"" . $fontface . "\" color=\"" . $fonti . "\" size=\"" . $fontsize . "\"> \n ";

Is immer noch parse error in line 2.

in der ersten Zeile steht "<?php" also viellecht meinte er damit die 3. Zeile, <?php nicht mitgerechnet.
 
zeile 2 .... das is doch bei dir include, guck ma ob die datei genso so heists wie angegebn, mit groß klein schreibung etc und ob in dem script auch alles stimmt, welches du einfügst
 
Hä? Isses nich. Ich red nicht mehr von der index.php, da ist bisher alles (fast) in Ordnung. Nur da erscheint noch so ein Backslash. (hier )

Wie bekommt man den Weg?

Ich red von einer copy.php (also die Copyrights)

Die sieht so aus:

PHP:
<?php
echo "<body bgcolor='" . $bodybg "'> \n ";
echo "<font face=\"" . $fontface . "\" color=\"" . $fonti . "\" size=\"" . $fontsize . "\"> \n ";
include("copyrights.txt");
echo "</font> \n ";
?>
 
Jetzt hab ich einen parse error in Zeile 115. :#

What the fuck is this??? :-[


PHP:
<?php
include("connect.php");


//Abfrage der relevanten Daten
$strSQL = "SELECT ID,gegner,kurz,URL,playerhome,playerout,maphome,mapout,roundtime,termin,time,server,ergmaphomehome,ergmaphomeout,ergmapouthome,ergmapoutout FROM WJ_cscwp ORDER BY ID DESC";
$hErgebnis = @mysql_query($strSQL)
or die("Abfrage $strSQL ist Fehlgeschlagen <br> \n " .
mysql_errno() . ":" . mysql_error());


echo "<body bgcolor= " .$bodybg . " alink=\"" . $linkcol . "\" link=\"" . $linkcol . "\" vlink=\"" . $linkcol . "\">";

echo "<link rel=\"stylesheet\" href=\"http://kfd.strikenet.de/bg.css\" type=\"text/css\">";
echo "<link rel=\"stylesheet\" href=\"http://kfd.strikenet.de/links.css\" type=\"text/css\">";

?>

<script language="JavaScript">
   function fightus() {
     window.open('http://www.kfd-clan.f2s.com/clanwar/fightus.php',
                 'FightUs','width=380, height=280,resizable=no');
   }

   function copyright() {
     window.open('http://www.kfd-clan.f2s.com/clanwar/copy.php',
                 'Copyright','width=640, heigth=480, resizable=yes, scrollbars=yes');
   }
</script>

<?php

if (mysql_num_rows($hErgebnis)) 
{

echo "<center> \n <table border=\"" . $aborder . "\" bgcolor=\"" . $atblcol . "\" bordercolor=\"" . $abordcol . "\" width=\"80%\" cellspacing=\"0\"> \n <tr> \n <td> \n <center> \n <font color=\"" . $afont . "\"> \n <h2> \n <b> \n " . $homeclan . "</h2> \n </b> \n </font> \n";
echo "<p> \n <font face=\"" . $fontface . "\" color=\"" . $fonti . "\" size=\"" . $fontsize . "\"> \n Warplaner </font> \n </center> \n </td> \n </tr> \n ";
echo "<tr> \n <td> \n <center> \n <font face=\"" . $fontface . "\" color=\"" . $fonti . "\" size=\"" . $fontsize . "\"> <a href=\"javascript:fightus()\"> \n SIGN IN FOR CW </a> \n </center> \n </td> \n </tr>\n";
echo "<tr> \n <td> \n <table border=\"1\" bgcolor=" .$itablecolor . " bordercolor=$ibordercolor width=\"100%\"> \n ";
while($oZeile = mysql_fetch_array($hErgebnis))

{

for($i = 1; $i < mysql_num_rows($hErgebnis); $i ++ ) {
echo "<tr> \n <td width=\"20%\" valign=\"top\"> \n";
echo "<font face=\"" . $fontface . "\" color=\"" . $fonti . "\" size=\"" . $fontsize . "\"> \n";
echo "<a href=\"http://";
echo $oZeile["URL"];
echo "\"> \n <b> \n ";
echo $oZeile["gegner"];
echo " </b> </a>";
echo "<p> \n VS <p> \n";
echo "<b> \n";
echo $homeclan;
echo "</b> \n";
echo "<p> \n";
echo $oZeile["termin"];
echo "<br> \n";
echo $oZeile["time"];
echo "</font> \n";
echo "</td> \n <td valign=\"top\"> \n";
echo "<font face=\"" . $fontface . "\" color=\"" . $fonti . "\" size=\"" . $fontsize . "\"> \n";
echo "Server-IP:";
echo $oZeile["server"];
echo "<p> \n";
echo "Roundtime:";
echo $oZeile["roundtime"];
echo "<p> \n";
echo "Spieler ";
echo $oZeile["kurz"];
echo ":";
echo $oZeile["playerout"];
echo "<p> \n";
echo "Spieler ";
echo $homekurz;
echo ":";
echo $oZeile["playerhome"];
echo "</font> \n </td> \n <td width=\"20%\" valign=\"top\"> \n ";
echo "<font face=\"" . $fontface . "\" color=\"" . $fonti . "\" size=\"" . $fontsize . "\"> \n";
echo "Map ";
echo $oZeile["kurz"];
echo ":";
echo $oZeile["mapout"];
echo "<p> \n";
echo "Map ";
echo $homekurz;
echo ":";
echo $oZeile["maphome"];
echo "</font> \n";
echo "</td> \n </tr> \n <tr> \n <td> \ </td> \n <td> \n";
echo "<center> \n <font face=\"" . $fontface . "\" color=\"" . $fonti . "\" size=\"4\"> \n ERGEBNISSE </font> \n </center> \n <p> \n";
echo "<font face=\"" . $fontface . "\" color=\"" . $fonti . "\" size=\"" . $fontsize . "\"> \n";
echo "<u> \n <b> \n ";
echo $oZeile["mapout"];
echo "</u> \n </b> \n ";
echo "<br> \n <br> \n";
echo $oZeile["kurz"];
echo " : ";
echo $oZeile["ergmapoutout"];
echo "&nbsp; &nbsp; &nbsp;";
echo $homekurz;
echo " : ";
echo $oZeile["ergmapouthome"];
echo "<br> \n <hr> \n <br> \n";
echo "<u> \n <b> \n ";
echo $oZeile["maphome"];
echo "</u> \n </b> \n ";
echo "<br> \n <br> \n";
echo $oZeile["kurz"];
echo " : ";
echo $oZeile["ergmaphomeout"];
echo "&nbsp; &nbsp; &nbsp;";
echo $homekurz;
echo " : ";
echo $oZeile["ergmaphomehome"];
echo "</td> \n <td> \n &nbsp; </td> \n ";
echo "</tr> \n";
echo "<tr> \n <td bgcolor=\"" . $trenn . "\"> \n &nbsp; </td> \n <td bgcolor=\"" . $trenn . "\"> \n &nbsp; </td> \n <td bgcolor=\"" . $trenn . "\"> \n &nbsp; </td> \n </tr> \n";
}


}

echo "</table> \n </tr> \n <tr> \n <td border=\"" . $aborder . "\" bgcolor=\"#006699\"> \n ";
echo "<center> \n <font face=\"" . $fontface . "\" color=\"" . $fonti . "\" size=\"" . $fontsize . "\"><a href=\"javascript:fightus()\"> \n SIGN IN FOR CW </a> \n </p> \n ";
echo "</center> \n </td> \n </tr> \n";
echo "<tr> \n <td> \n <font face=\"" . $fontface . "\" color=\"" . $fonti . "\" size=\"1\"><a href=\"javascript:copyright()\"> \n <center> \n copyrights </center> \n </a> \n </font> \n ";
echo "</td> \n </tr> \n";
echo "</table> \n  ";

}
else
{
echo "<center> \n";
echo "<font face=\"" . $fontface . "\" color=\"" . $fonti . "\" size=\"" . $fontsize . "\"> \n Es gibt leider noch keine Einträge.";
echo "<p> \n";
echo "<a href=\"javascript:fightus()\"> \n SIGN IN FOR CW </a> \n </p> \n ";
echo "</font> \n </center> \n";
}
?>
 
Also jetzt hab ich keine parse error mehr.

Wenn folgendes in der index.php steht:

PHP:
for($i = 1; $i < mysql_num_rows($hErgebnis); $i ++ )

zeigt er GAR nichts an.

Wenn

PHP:
for($i = 1; $i <= mysql_num_rows($hErgebnis); $i ++ )

da drin steht, zeigt er alles normal an, mit Backslash.

Wenn

PHP:
for($i = 0; $i <= mysql_num_rows($hErgebnis); $i ++ )

da steht, zeigt er den Eintrag gleich zweimal an. Mit Backslash.

Wenn

PHP:
for($i = 0; $i < mysql_num_rows($hErgebnis); $i ++ )

da steht, zeigt er alles normal an. Mit Backslash....

AAAH! :-[ :[
 

Neue Beiträge

Zurück