Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Empfohlene Antworten

Veröffentlicht

Hallo Leute,

mal eine (dumme) Frage, ich wollte mithilfe von PHP ein Array aus der Datenbank einlesen. Und dann dieses Array mit den darin enthaltenen Objekt ausgeben in einer Schleife. Nur irgendwie geht das nicht?

<html>
<head>
<title>Gahterliste</title>
</head>
<body>
<?php
include_once(@"gather.class.php");
$liste = gather::listGathers();
echo("<table border=\"1\">");

for($i = 0; $i <= sizeof($liste) - 1; $i++)
{
echo("<tr><td>" . $liste[$i]->getName() . "</td><td>" . $liste[$i];->getGame() . "</td></tr><tr><td>" . $liste[$i]->getServer() . "</td><td>" . $liste[$i]->getVoice() . "</td></tr>");
}

echo("<tr><td rowspan='2'>insgesamt gemeldet " . $sizeof($liste) . "</td></tr></table>");
?>
</body>
</html>[/PHP]

Ich hatte es zuerst mit einer foreach-Schleife probiert, aber dann kam invalid argruement, und jetzt kommt der Fehler:

[code] Parse error: syntax error, unexpected ';' in /var/www/web16/html/gather/gather_liste.php on line 13 [/code]

Ich verstehs nicht, in Java oder C# würde es doch so auch gehen. Wahrscheinlich blos ein kleiner Fehler, wie immer -.-

Nabend,


echo("<tr><td>" . $liste[$i]->getName() . "</td><td>" . $liste[$i][COLOR="red"][SIZE="5"];

[/SIZE][/COLOR]->getGame() . "</td></tr><tr><td>" . $liste[$i]->getServer() . "</td><td>"

. $liste[$i]->getVoice() . "</td></tr>");

Gruß

axxis

  • Autor

Ah ok, Flüchtigkeitsfehler, danke, Thema geklärt.

Und ja, ich hatte die Fehlermeldung gelesen, hab mir auch mindestens 5 mal die Zeile angeschaut, aber keinen Fehler gefunden. Naja, ihr wisst ja wie das ist, dass man seine eigenen Fehler nicht so leicht sieht, wie andere ;-)

Erstelle ein Konto oder melde dich an, um einen Kommentar zu schreiben.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.