PDA

Archiv verlassen und diese Seite im Standarddesign anzeigen : Hat sich was geändert (PHP & Subtraktion) ?



Xyla
02.09.2003, 07:02
Hallo Leute,

ich bin mal wieder ratlos.
Seit nunmehr mehreren Jahren (2-3 ;)) betreiben wir auf unserer Fanpage eine Livetabelle, welche PHP und MySQL gestützt ist.
Bis gestern Nachmittag lief Sie auch ohne Probleme.
Seit gestern abend haut das Ding nicht mehr hin. Bei der Tordifferenz spinnt Sie, sobald neative Werte heraus kommen.
Ist ne neue PHP Version raus, die das anders macht oder was könnte die Ursache sein ?
Ich habe das Script seit über einem Jahr nicht angerührt!

Hier der Link, welcher den derzeitigen Zustand zeigt (http://www.sachsen-leipzig.de/tabelle/tabelle.php3)

und hier Auszüge aus dem Quelltext:

$query = MYSQL_QUERY("SELECT id, name, spiele, (tore + t) AS tplus,
(gegentore + gt) AS tminus, ((tore + t) - (gegentore + gt)) AS diff ,(punkte
+ p) AS pstand, status FROM tipp_vereine, tipp_temp WHERE id = vid
ORDER BY pstand DESC, diff DESC");

$place = 1;

while ($row = MYSQL_FETCH_OBJECT($query))
{
$style = ""; // <- Hier ggf. andere Standard-Style-Klasse angeben, falls gew&uuml;nscht

if ($place < 3) { $style = "aufsteiger"; }
else if ($place > 14) { $style = "absteiger"; }

if ($row->id == 1) { $style = "fcs"; }

if ($row->status == 1)
{
$style .= "hi"; // Vorl&auml;ufige Eintr&auml;ge kennzeichnen
$row->spiele++;
}

if ($row->tplus < 10) { $row->tplus = "&nbsp;".$row->tplus; }
if ($row->tminus < 10) { $row->tminus .= "&nbsp;"; }

echo "\n <TR>";
echo "\n <TD ALIGN=\"CENTER\" CLASS=\"$style\">$place</TD>";
echo "\n <TD ALIGN=\"LEFT\" CLASS=\"$style\">".$row->name."</TD>";
echo "\n <TD ALIGN=\"CENTER\" CLASS=\"$style\">".$row->spiele."</TD>";
echo "\n <TD ALIGN=\"CENTER\" CLASS=\"$style\">".$row->tplus." : ".$row->tminus."</TD>";
echo "\n <TD ALIGN=\"CENTER\" CLASS=\"$style\">".$row->diff."</TD>";
echo "\n <TD ALIGN=\"CENTER\" CLASS=\"$style\">".$row->pstand."</TD>";
echo "\n </TR>";
$place++;
}

MYSQL_CLOSE($connect);

?>

und so hab ich mir dann geholfen, aber warum funktiert das obere Beispiel bis gestern Mittag und danach nicht mehr ???


$query = MYSQL_QUERY("SELECT id, name, spiele, tore, gegentore, (tore + t) AS tplus,
(gegentore + gt) AS tminus, ((tore + t) - (gegentore + gt)) AS diff ,(punkte
+ p) AS pstand, status FROM tipp_vereine, tipp_temp WHERE id = vid
ORDER BY pstand DESC, diff DESC");

$place = 1;

while ($row = MYSQL_FETCH_OBJECT($query))
{
$style = ""; // <- Hier ggf. andere Standard-Style-Klasse angeben, falls gew&uuml;nscht

if ($place < 3) { $style = "aufsteiger"; }
else if ($place > 14) { $style = "absteiger"; }

if ($row->id == 1) { $style = "fcs"; }

if ($row->status == 1)
{
$style .= "hi"; // Vorl&auml;ufige Eintr&auml;ge kennzeichnen
$row->spiele++;
}

if ($row->tplus < 10) { $row->tplus = "&nbsp;".$row->tplus; }
if ($row->tminus < 10) { $row->tminus .= "&nbsp;"; }
$diff=$row->tore-$row->gegentore;
echo "\n <TR>";
echo "\n <TD ALIGN=\"CENTER\" CLASS=\"$style\">$place</TD>";
echo "\n <TD ALIGN=\"LEFT\" CLASS=\"$style\">".$row->name."</TD>";
echo "\n <TD ALIGN=\"CENTER\" CLASS=\"$style\">".$row->spiele."</TD>";
echo "\n <TD ALIGN=\"CENTER\" CLASS=\"$style\">".$row->tplus." : ".$row->tminus."</TD>";
echo "\n <TD ALIGN=\"CENTER\" CLASS=\"$style\">".$diff."</TD>";
echo "\n <TD ALIGN=\"CENTER\" CLASS=\"$style\">".$row->pstand."</TD>";
echo "\n </TR>";
$diff="";
$place++;
}

MYSQL_CLOSE($connect);

?>

Ich hoffe Ihr könnt mir weiterhelfen und bedanke mich schonmal

MfG
Xyla

Hellraider
08.09.2003, 09:40
Frag ggf. mal bei Deinem Hoster nach OB und WANN die an der Konfiguratoin der Rechner was geändert haben, z.B. Aufspielen einer neuen PHP Version.

martin
08.09.2003, 14:19
das ist kein php, sondern ein mysql problem. allerdings weiss ich nicht, ob das tatsächlich ein problem ist. ich hab mich mit den mysql-eigenen rechenkünsten noch nie beschäftigt.
wäre möglich, dass dein anbieter auf mysql 4 aktualisiert hat und es deshalb nicht mehr funktioniert, weil sie da gegenüber mysql 3 etwas geändert hat.

Hellraider
08.09.2003, 16:54
Hat auch keiner gesagt dass das PHP ist:


z.B. Aufspielen einer neuen PHP Version. ;)