@ 2014-09-03T15:52:22Z <?php
$verbindung = mysqli_connect("server","user","pw");
mysqli_select_db($verbindung,"userdaten");
/* Ermittlung der eigenen ID */
$abfrage = "select userid from accountdaten where username = '" . $_SESSION["username"] . "'";
$ergebnis = mysqli_query($verbindung, $abfrage) OR die("Error: $abfrage <br>".mysqli_error());
$row = mysqli_fetch_assoc($ergebnis);
/* Ermittlung der ID des Freundes */
$abfrage2 = "select freundid from freunde where userid = " . $row["userid"] . "";
$ergebnis2 = mysqli_query($verbindung, $abfrage2) OR die("Error: $abfrage2 <br>".mysqli_error());
$row2 = mysqli_fetch_assoc($ergebnis2);
$num = mysqli_num_rows($ergebnis2);
/* Prüfung, ob man bisher schon Freunde hat */
if($num == 0)
{
echo "Du hast bisher noch keine Freunde.";
}
else
{
/* Ermittlung des Usernamen und den Online-Status des Freundes */
$abfrage3 = "select username, online from accountdaten where userid = " . $row2["freundid"] . "";
$ergebnis3 = mysqli_query($verbindung, $abfrage3) OR die("Error: $abfrage3 <br>".mysqli_error());
$row3 = mysqli_fetch_assoc($ergebnis3);
/* Ermittlung der Userdaten, die für die Ausgabe gebraucht werden */
$abfrage4 = "select nation, klasse, Level from userwerte where userid = " . $row2["freundid"] . "";
$ergebnis4 = mysqli_query($verbindung, $abfrage4) OR die("Error: $abfrage4 <br>".mysqli_error());
echo "<table>";
echo "<thead><tr>
<th>Name</th>
<th>Herkunft</th>
<th>Klasse</th>
<th>Level</th>
<th>Online-Status</th>
</tr></thead>
<tbody>";
while($dsatz = mysqli_fetch_array($ergebnis4, MYSQL_ASSOC))
{
echo "<tr>";
/* Wie kann ich $row3 mit in die while Funktion einbringen? */
echo "<td>" . $row3["username"] . "</td>";
echo "<td>" . $dsatz["nation"] . "</td>";
echo "<td>" . $dsatz["klasse"] . "</td>";
echo "<td>" . $dsatz["Level"] . "</td>";
echo "<td></td>";
echo "</tr>";
}
echo "</tbody></table>";
}
mysqli_close($verbindung);
?>
Enable javascript to submit You have javascript disabled. You will not be able to edit any code.
Output for 7.0.0 - 7.0.33 , 7.1.0 - 7.1.33 , 7.2.0 - 7.2.33 , 7.3.0 - 7.3.33 , 7.4.0 - 7.4.33 , 8.0.0 - 8.0.30 , 8.1.0 - 8.1.28 , 8.2.0 - 8.2.18 , 8.3.0 - 8.3.4 , 8.3.6 Fatal error: Uncaught Error: Call to undefined function mysqli_connect() in /in/aqmn8:2
Stack trace:
#0 {main}
thrown in /in/aqmn8 on line 2
Process exited with code 255 . Output for 8.3.5 Warning: PHP Startup: Unable to load dynamic library 'sodium.so' (tried: /usr/lib/php/8.3.5/modules/sodium.so (libsodium.so.23: cannot open shared object file: No such file or directory), /usr/lib/php/8.3.5/modules/sodium.so.so (/usr/lib/php/8.3.5/modules/sodium.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
Fatal error: Uncaught Error: Call to undefined function mysqli_connect() in /in/aqmn8:2
Stack trace:
#0 {main}
thrown in /in/aqmn8 on line 2
Process exited with code 255 . Output for 5.0.0 - 5.0.5 , 5.1.0 - 5.1.6 , 5.2.0 - 5.2.17 , 5.3.0 - 5.3.29 , 5.4.0 - 5.4.45 , 5.5.0 - 5.5.38 , 5.6.0 - 5.6.40 Fatal error: Call to undefined function mysqli_connect() in /in/aqmn8 on line 2
Process exited with code 255 . Output for 4.4.5 - 4.4.9 Fatal error: Call to undefined function: mysqli_connect() in /in/aqmn8 on line 2
Process exited with code 255 . Output for 4.3.2 - 4.3.11 , 4.4.0 - 4.4.4 Fatal error: Call to undefined function: mysqli_connect() in /in/aqmn8 on line 2
Process exited with code 255 . Output for 4.3.0 - 4.3.1 Fatal error: Call to undefined function: mysqli_connect() in /in/aqmn8 on line 2
preferences:dark mode live preview
304.72 ms | 401 KiB | 459 Q