chcialbym uzyc klasy w postaci dodawania newsa do bazy ale nie wiem czemu nie dziala klasa ma postac
<? class przyklad { function dodaj($dbname) { $sql = \"INSERT INTO newsy VALUES (null, '$naglowek', '$tresc', '$data', '$kategoria_id')\"; endif; ?> <table width=\"600\" align=\"center\" border=1> <tr><td><center><h3>Dopisz wiadomosc do bazy danych</h3></center></td></tr> <tr bgcolor=\"dddddd\"><td><center>Tytul:</center></td></tr> <tr><td><center><input type=\"text\" size=\"90\" name=\"naglowek\"></center></td></tr> <tr bgcolor=\"dddddd\"><td><center>Tresc:</center></td></tr> <tr><td><center><textarea name=\"tresc\" cols=\"70\" rows=\"10\" wrap=\"VIRTUAL\"></textarea></center></td></tr> </table> <center><input type=\"submit\" name=\"submit\" value=\"submit\"><input type=\"reset\" value=\"reset\"></center> <? } } ?>
tzn chodzi o to ze wyswietlac wyswietla sie dobrze ale nie dodaje wiadomosci