Answer the question
In order to leave comments, you need to log in
Why an empty array?
Can you tell me why the array can be empty? those. when you click on the button named save, the record is safely added to the associated table. but when you try to get this $_SESSION['logged_user']->ownPapkyList method - the array is empty. Is there a gross error in this entry? because I'm learning php for a couple of days. It's just that if there was an error somewhere else, the record would not be added, right?
<?php
$data = $_POST;
if (isset($data['save'])) {
$papka = R::dispense('papki');
$papka->imya = $data['papkaname'];
$_SESSION['logged_user']->ownPapkyList[] = $papka;
R::store($_SESSION['logged_user']);
}
print_r($_SESSION['logged_user']->ownPapkyList);
?>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question