S
S
Samurai-sicquze2020-04-17 17:18:59
PHP
Samurai-sicquze, 2020-04-17 17:18:59

How can I display the number of user?

$left_from_chat = $db->query("SELECT COUNT(*) FROM user_confs WHERE peer_id = 2000000008 AND left_from_chat = 1");
$vk->sendMessage($peer_id, $left_from_chat);

There is such a code, I need to display the number of users with $left_from_chat = 1 from the database, but because I'm a stupid person, the request is apparently not correct, and instead of the number of users, I get in var_dump
object(mysqli_result)#2 (5) { ["current_field"]=> int(0) ["field_count"]=> int(1) ["lengths"]=> NULL ["num_rows"]=> int(1) ["type"]=> int(0) }

Answer the question

In order to leave comments, you need to log in

2 answer(s)
1
15x03243, 2020-04-17
@KenKup

Perhaps this is https://www.php.net/manual/ru/function.count.php ?

V
Vladislav, 2020-04-17
@cr1gger

5e99c2c195805756271407.png
Everything works. Try to substitute my request.

SELECT COUNT(*) FROM `bp_users` WHERE `login` = 'isus' and `email` = '[email protected]'

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question