0
<!DOCTYPE html>

<html>
    <head>
        <meta charset="UTF-8">
        <title></title>
    </head>
    <body>
        <?php
          require_once "../reg file/login.php";

          $db = "mydb1";

          $connection = new mysqli($hn, $un, $pw, $db);

          if ($connection->connect_error) die("Fatal error");

          $stmt = $connection->prepare("INSERT INTO games VALUES(?,?,?)");

          $stmt->bind_param("sss", $name, $genre, $date); //Fatal error:
// Uncaught Error: Call to a member function bind_param() on bool
          $name = "Call of Duty: Modern Warfare 3";
          $genre = "Shooter";
          $date = "2011";
          $stmt->execute();

          echo $stmt->affected_rows . " rows inserted.<br>";
          $stmt->close();
          $connection->close();
        ?>
    </body>
</html>

Ошибка: Fatal error: Uncaught Error: Call to a member function bind_param() on bool
Что я сделал не так?

JustLearn
  • 672

0 Answers0