I
I
Ivan Kutsenko2019-12-24 22:20:18
PHP
Ivan Kutsenko, 2019-12-24 22:20:18

Where is the error in the code or in the request?

you need to display a list of those who received varn through the bot in a conversation. created a vk_id column, it is in the warns table. I don't understand what's wrong

if($cmd == "варнлист"){
    if($vk->isAdmin($peer_id, $id)){
      $result = mysql_query("SELECT `vk_id` FROM `warns`");
        $myrow = mysql_fetch_array($result);
      $vk->sendMessage($peer_id, "ID заварненных:{$myrow}['vk_id']");
    }
  }

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander, 2019-12-24
@AleksandrB

Doesn't $myrow contain an array? If you need to display a list of persons with a varna, you need to output it in a loop.

foreach($myrow as $item) {
 echo $item['vk_id']
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question