Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> klay i obiekty :/
-Gość_kafar-
post
Post #1





Goście







Zrobiłem coś takiego korzystając z manuala. Co jest nie tak.
  1. <?php
  2. class connect_db {
  3. var $user;
  4. var $host;
  5. var $pw;
  6. var $dbname;
  7. var $sql_query;
  8. function connect_db_mysql (){
  9.  $this -> user = root;
  10.  $this -> host = localhost;
  11.  $this -> pw = krasnal;
  12.  $this -> dbname = php;
  13.  $db = mysql_connect(&#092;"$this -> host\", \"$this -> root\", $this -> pw);
  14.  mysql_select_db(&#092;"$this -> dbname\", $db);
  15.  }
  16. function sql_query($sql_query){
  17. connect_db_mysql ();
  18. mysql_query($sql_query);
  19. }
  20. }
  21.  
  22. ?>
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
ActivePlayer
post
Post #2





Grupa: Przyjaciele php.pl
Postów: 1 224
Pomógł: 40
Dołączył: 6.07.2004
Skąd: Wuppertal

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


  1. <?php
  2. class connect_db {
  3. var $user;
  4. var $host;
  5. var $pw;
  6. var $dbname;
  7. var $sql_query;
  8. function connect_db_mysql (){
  9.  $this -> user = &#092;"root\";
  10.  $this -> host = &#092;"localhost\";
  11.  $this -> pw = &#092;"krasnal\";
  12.  $this -> dbname = &#092;"php\";
  13.  $db = mysql_connect($this -> host, $this -> root, $this -> pw);
  14.  mysql_select_db(&#092;"$this -> dbname\", $db);
  15.  }
  16. function sql_query($sql_query){
  17. connect_db_mysql ();
  18. mysql_query($sql_query);
  19. }
  20. }
  21.  
  22. ?>
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: 10.10.2025 - 14:44