Hallo zusammen,
ich habe an meiner Webseite weiter geschrieben, allerdings bekomme ich jetzt viele neue Fehler angezeigt:
Notice: Undefined index: REQUEST_URL in C:\xampp\htdocs\Berlinblog\Kommentare.php on line 71
Notice: Undefined variable: ergebnis in C:\xampp\htdocs\Berlinblog\Kommentare.php on line 89
Warning: mysqli_fetch_object() expects parameter 1 to be mysqli_result, null given in C:\xampp\htdocs\Berlinblog\Kommentare.php on line 89
Warning: mysqli_query() expects at least 2 parameters, 1 given in C:\xampp\htdocs\Berlinblog\Kommentare.php on line 99
Warning: mysqli_fetch_object() expects parameter 1 to be mysqli_result, null given in C:\xampp\htdocs\Berlinblog\Kommentare.php on line 100
Ich komme einfach nicht weiter, was das Problem bei allen ist.
Über Hilfe würde ich mich sehr freuen :)
Mfg: S.Koller
Code (ich konnte nicht den gesamten reinpacken wegen Begrenzung D:):
<h1><br><br><br>Kommentare: </h1>
<fieldset>
<legend>Neuer Eintrag</legend> <a href="schreiben.html">Neuen Eintrag schreiben »</a> </fieldset>
<fieldset>
<legend>Gästebuch</legend>
<?php $servername = "localhost"; $user = "root"; $passwort = ""; $db = "berlin";
$verbindung = new mysqli($servername, $user, $passwort, $db);
$pagesuche = 0; $url = $_SERVER["REQUEST_URL"]; $pagesuche = strpos($url, "?page=");
if($pagesuche == "") {
$page = 1;
} else {
$page = $_GET["page"];
}
$wo = ($page * 5) -5;
$wo++;
$zahl = 0; $pos = 0; $abfrage ="SELECT id FROM gbook ORDER BY id DESC"; $ergebnis = mysqli_query($abfrage); while($row = mysqli_fetch_object($ergebnis)) { if($zahl == $wo){ $pos =$row->id; } $zahl++; }
$abfrage ="SELECT * FROM gbook WHERE is<= '$pos' ORDER BY id DESC LIMIT 5";
$ergebnis = mysqli_query($abfrage);
while($row = mysqli_fetch_object($ergebnis)){
?>
<h3><?php echo $row->name; ?> <small style="color:grey">schrieb:</small></h3> <p><?php echo $row->nachricht; ?></p> <h5 style="color:grey;"><?php echo $row->datum; ?></h5> <hr /> <?php } $verbindung -> close();
?>
</fieldset>
</body> </html>