Answer the question
In order to leave comments, you need to log in
Why is RedBeanPHP not getting data from a table?
The thing is, I'm using RedBeanPHP. And I build queries like this:
$userID = $_GET['id'];
R::selectDatabase('database');
$userDataID = R::findOne('post', 'user_id = ?', [$userID]);
$postName = $userDataID->title;
$postContent = $userDataID->content;
$postTags = $userDataID->metaTags;
echo "данные поста";
Answer the question
In order to leave comments, you need to log in
I solved the problem. finfoOne(); receives data from the table as an object. To represent this object as an array, use export $arrayUserDataID = $userDataID->export(); and from the variable $arrayUserDataID you can get data as from an array - $arrayUserDataID['title']
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question