public function add Solution ()
{
$ userID = Session :: get ('id');
$ idPracyDomowej = $ _POST ['homework_id'];
$ content = $ _POST ['content'];
$ transfer_name = date ('Y-m-d H: i: s');
$ database = new Database ();
$ BazaDanych-> connect ();
$ query = 'INSERT INTO `solution` (
`user_id`,` homework_id`, `content`,` upload_date`
) VALUES (?,?,?,?) ';
$ query result = $ database-> query ($ query,
[$ userID, $ homeID, $ content,
$ DataPrzeslania]);
if ($ inquiry result> 0) {
Message :: success ('Solution successfully added!');
header ('Location:'. Settings :: get ('appURL'). 'my-works');
} else {
Message :: error ('An error occurred while adding
solutions!');
header ('Location:'. Settings :: get ('appURL'). 'add-
solution-form '); //
}
}
Undefined index: work_homes_id in C: \ xampp \ htdocs \ suu \ Classes \ PracaDomowa.php on line 150
Undefined index: tresc in C: \ xampp \ htdocs \ suu \ Classes \ PracaDomowa.php on line 152
What is going on? Where is the mistake