php - converted to string database -


) wrote method display contents of database public

function magazyn() {         //return 'magazyn';         $this->magazyn = $this->conn->prepare("select * `products` order `nazwa`");         //$this->magazyn->bind_param('ssss', $id, $nazwa, $kategoria, $sn);         $this->magazyn->execute();         $this->magazyn->store_result();         return $this->magazyn;          if ($this->magazyn->num_rows > 0) {             echo "jest cos w magazynie";         } else {             echo "brak produktw w bazie";         }     }      function __tostring() {         return $this->magazyn;     }  $web = new web(); echo $web->magazyn(); 

and in site have error:

catchable fatal error: object of class mysqli_stmt not converted string in...


Comments

Popular posts from this blog

javascript - Laravel datatable invalid JSON response -

java - Exception in thread "main" org.springframework.context.ApplicationContextException: Unable to start embedded container; -

sql server 2008 - My Sql Code Get An Error Of Msg 245, Level 16, State 1, Line 1 Conversion failed when converting the varchar value '8:45 AM' to data type int -