Ale nie w tym problem.

Stworzyłem klasę do obsługi bazy danych mysql.
<?php class sql { private $link; private $result; public $rows; public function __construct { $this -> $sql_host = 'localhost'; // Adres serwera bazy danych $this -> $sql_name = 'forum'; // Nazwa bazy danych $this -> $sql_user = 'root'; // Nazwa usera $this -> $sql_password = ''; // Hasło $this -> $sql_port = '3306'; // Port } } public function __destruct () { } } public function query($query) { } public function fetch_row() { return 1; } } } ?>
I nie działa.

Cały kod wygląda tak.
<?php class sql { private $link; private $result; public $rows; public function __construct { $this -> $sql_host = 'localhost'; // Adres serwera bazy danych $this -> $sql_name = 'forum'; // Nazwa bazy danych $this -> $sql_user = 'root'; // Nazwa usera $this -> $sql_password = ''; // Hasło $this -> $sql_port = '3306'; // Port } } public function __destruct () { } } public function query($query) { } public function fetch_row() { return 1; } } } $sql = new sql; $sql -> $query('SELECT username FROM users'); while($sql -> fetch_row()){ } ?>
Co jest źle?