mam taki kod:
public function __construct($ID)
{
$this -> db = new mysqli('localhost','root','piotrek','mojastrona');
}
//$zapytanie = "SELECT * FROM artykul";
$wynik = $this -> db ->query("SELECT * FROM artykul");
$wiersz = $wynik->fetch_assoc();
$this -> id = $ID;
$this -> name = $wiersz['nazwa'];
$this -> description = $wiersz['opis'];
public function getName()
{
return $this -> name;
}
i taki bład
Parse error: syntax error, unexpected T_VARIABLE, expecting T_FUNCTION in /var/www/class/class.demo.php on line 16
chodzi o fragment gdzie jest napisane zapytanie do bazy
dlaczego