Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [PHP]Błąd Call to a member function prepare() on a non-object, problem z kodem.
casperii
post
Post #1





Grupa: Zarejestrowani
Postów: 681
Pomógł: 28
Dołączył: 14.08.2014

Ostrzeżenie: (0%)
-----


Panowie próbuje się zalogować poprzez ajax. Niestety otrzymuje bład w pliku class.php
Fatal error: Call to a member function prepare() on a non-object in line 13 czyli linia gdzie jest:

  1. $sql = $this->db->prepare("SELECT * FROM tabelka WHERE user=:login") or die ($db->errorInfo());


class.php
  1. class xx{
  2. private $db;
  3.  
  4. function __construct($con){
  5. $this->pdo = $con;
  6.  
  7. }
  8. }


Może ktoś podpowiedzieć co robię źle?

Ten post edytował casperii 7.05.2016, 18:20:01
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 20.08.2025 - 15:13