Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [PHP] Fatal error: Call to a member function bind_param() on a non-object in
dachu
post
Post #1





Grupa: Zarejestrowani
Postów: 70
Pomógł: 0
Dołączył: 30.08.2005

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


cześć
poniższa instrukcja wywala mi błąd: Fatal error: Call to a member function bind_param() on a non-object...
die($db->error) wyświetla: "Nieznana komenda" ((IMG:style_emoticons/default/questionmark.gif) (IMG:style_emoticons/default/questionmark.gif) (IMG:style_emoticons/default/questionmark.gif) )
Używam PHP 5

Nie mogę znaleźć przyczyny problemu,,, może ktoś pomoże?


  1. $db = new mysqli("localhost", "root", "","test");
  2. if (mysqli_connect_errno()) {
  3. printf("Connect failed: %s\n", mysqli_connect_error());
  4. exit();
  5. }
  6.  
  7. $instruction = $db->prepare("INSERT INTO kontakty (imie,nazwisko,wiek) VALUES (?,?,?)") or die($db->error);
  8.  
  9. $imie = 'Jan';
  10. $nazwisko = 'Kowalski';
  11. $wiek = 45;
  12.  
  13. $instruction->bind_param('ssi',$imie,$nazwisko,$wiek);
  14. $instruction->execute();
  15.  
  16. echo $instruction->affected_rows;
  17.  
  18. $instruction->close();
  19. $db->close();


Ten post edytował dachu 14.10.2012, 13:32:40
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
nospor
post
Post #2





Grupa: Moderatorzy
Postów: 36 559
Pomógł: 6315
Dołączył: 27.12.2004




znaczy o to
Cytat
Fatal error: Call to a member function bind_param() on a non-object in c:\usr\apache\httpd\html\test.php

?

Jesli to to, to panie kolego to nie prze die() (IMG:style_emoticons/default/smile.gif) Nie wprowadzaj wbład (IMG:style_emoticons/default/smile.gif)
A jesli coś innego to podaj dokładnie co (IMG:style_emoticons/default/smile.gif)
Go to the top of the page
+Quote Post
dachu
post
Post #3





Grupa: Zarejestrowani
Postów: 70
Pomógł: 0
Dołączył: 30.08.2005

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


Cytat(nospor @ 15.10.2012, 17:06:42 ) *
znaczy o to

?

Jesli to to, to panie kolego to nie prze die() (IMG:style_emoticons/default/smile.gif) Nie wprowadzaj wbład (IMG:style_emoticons/default/smile.gif)
A jesli coś innego to podaj dokładnie co (IMG:style_emoticons/default/smile.gif)


to skąd mi sie bierze ten komunikat? po co miałbym kłamać? przecież wklejam to co otrzymuje...
To nie jest mój komunikat. Nigdzie czegoś takiego nie użyłem. To komunikat który otrzymuje stosując die().
KOrzystam z krasnala, na lokalu, więc może jakieś spolszczone erorry ... nie wiem
Go to the top of the page
+Quote Post

Posty w temacie


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

 



RSS Aktualny czas: 5.10.2025 - 01:07