[PHP] Call to a member function execute() on a non-object

Dieses Thema im Forum "Webentwicklung" wurde erstellt von Decryptor, 1. April 2013 .

Schlagworte:
  1. 1. April 2013
    Zuletzt bearbeitet: 1. April 2013
    Call to a member function execute() on a non-object

    Hi, ich würde gerne ne ID eines Forums aus der Datenbank auslesen, das funktioniert soweit auch so gut bei mir auf dem Lappy und auf OVH beides apache, nun hab ich aber das Problem
    "Fatal error: Call to a member function execute() on a non-object in .php"

    Handelt sich um ngnix mit php 5.3
    Code:
     <?php
    
    $mysqli = new mysqli("heradthehost", "userpls", "password", "dbpls");
    if ($mysqli->connect_error) {
     echo "Fehler bei der Verbindung: " . mysqli_connect_error();
     exit();
    }
    if (!$mysqli->set_charset("utf8")) {
     echo "Fehler beim Laden von UTF8 ". $mysqli->error;
    }
    
    
     $stmt = $mysqli->prepare("SELECT Max(tid) FROM topics");
     $stmt->execute();
     $stmt->bind_result($tid);
     $zeile = 0;
     while($stmt->fetch()) {}
     $stmt->close();
     echo "$tid";
    ?>
     
  2. 1. April 2013
    AW: Call to a member function execute() on a non-object

    Gibt dir mal den Fehler aus:
    php - Couldnt fetch mysqli - Stack Overflow
     
    1 Person gefällt das.
  3. 1. April 2013
    AW: Call to a member function execute() on a non-object

    danke, ich hatte auch ganz vergessen das man prefixe nutzen kann woran es auch lag :/
     
  4. Video Script

    Videos zum Themenbereich

    * gefundene Videos auf YouTube, anhand der Überschrift.