Don't understand where is the error in the code?

did the command "warnlist" and polkley to her database (in the beginning of the code), is used to do so, and the bot needs to send an array to the database
if($cmd == "warnlist"){
 if($vk->isAdmin($peer_id, $id)){
 $wlist = R::find('warns', `vk_id = ?`, array($vk_id));
 $vk->sendMessage($peer_id, "Data from database: {$wlist}\n");
}
}

when sending the bot sends this: "the Data from the database: Array"
don't know what even to do, read the rb documentation, made according to example
April 3rd 20 at 18:49
2 answers
April 3rd 20 at 18:51
if($cmd == "warnlist"){
 if($vk->isAdmin($peer_id, $id)){
 $wlist = R::find('warns', `vk_id = ?`, array($vk_id));
 $wlist = implode(", ", $wlist);
 $vk->sendMessage($peer_id, "Data from database: {$wlist}\n");
}
}
April 3rd 20 at 18:53
The problem is that you're using the array in the string. Instead of the recommended implode is better to use json_encode

Find more questions by tags PHPVKontakteBots