Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> __desctruct() jak?
eS...
post
Post #1





Grupa: Zarejestrowani
Postów: 367
Pomógł: 2
Dołączył: 4.03.2003
Skąd: C:/Windows/Temp

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


mam taka marna klase (IMG:http://forum.php.pl/style_emoticons/default/smile.gif) i zastanawiam sie jak uzyc __destruct
  1. <?
  2. class BD {
  3. var $host = '';
  4. var $user = '';
  5. var $pass = '';
  6. var $dbname = '';
  7.  
  8. function __construct(){
  9. $this->connect();
  10. }
  11.  
  12. function connect(){
  13. mysql_connect($this->host,$this->user,$this->pass) or die ($this->error());
  14. mysql_select_db($this->dbname)or die ($this->error());
  15. }
  16.  
  17. function error(){
  18. echo &#092;"error\";
  19. error_log(&#092;"Błąd na stronie\", 1, \"admin@admin.pl\",\"Subject:błąd:From:eroor class\");
  20. }
  21.  
  22. //  chodzi mi o to czy to robi sie tak
  23.  function __destruct(){
  24.  $this->connect();
  25. }
  26. //czy poprostu wywoluje sie sama funkcje __destruct i po sprawie??
  27. }
  28. ?>

dzięki
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: 22.08.2025 - 17:22