php mysql Create View bind_param error

0

Cześć mam taki problem, gdy zwykłym selectem(Bez tworzenia widoku) wykonuje następujące zapytanie to wszystko jest ok, jednak gdy dodam tworzenie widoku to dostaje błąd że nie można zbindować parametrow,

Call to a member function bind_param() on boolean in


 public function getCarDay($day) {
  		 $stmt= $this->conn->prepare("CREATE OR REPLACE View ViewDay as (SELECT *,(SELECT AVG(speed) from Car WHERE  day=? ) AS average from Car WHERE day = ? ORDER BY day,hours ;");
          $stmt->bind_param("ss", $day,$day);
        $stmt->execute(); 
        $results = $stmt->get_result();
        $stmt->close();
        return $results;
   		 }
0

If the database server successfully prepares the statement, PDO::prepare() returns a PDOStatement object. If the database server cannot successfully prepare the statement, PDO::prepare() returns FALSE

Sformatuj to zapytanie to znajdziesz błąd.

0

wiem ze nie ma ), ale to nie rozwiazuje problemu

1 użytkowników online, w tym zalogowanych: 0, gości: 1