Answer the question
In order to leave comments, you need to log in
How in this case to select only the necessary user from a DB?
Good afternoon.
Implemented an application system for the tg bot, here is a piece of the application generator code:
elseif($bd_user['lap'] == 2)
{
$data_bd = json_decode($bd_user['data'], true);
$data_bd['w'] = $text;
$sth = $db->prepare("UPDATE `user` SET `data` = '', `lap` = '', `stage` = '' WHERE `tg_id` = :tg_id");
$sth->execute(array('tg_id' => user_chat_id()));
$array_user = $sth->fetch(PDO::FETCH_ASSOC);
$mess = "У нас новая заявка в шопе!\n\n Юзер: @".$bd_user['tg_username']."\nВопрос 1: <code>".$data_bd['s']."</code>\nВопрос 2: <code>".$data_bd['e']."</code>\n Вопрос 3: <code>".$data_bd['w']."</code>";
send_tg_text_priv($mess, inline_button_invite_admin(), $config['chat']['admin']);
$okay = "Ожидайте ответа!";
send_tg_text($okay, button_1());
}
$sth = $db->prepare("SELECT * FROM `user` WHERE `tg_id` = :tg_id");
$sth->execute(array('tg_id' => user_chat_id()));
$bd_user = $sth->fetch(PDO::FETCH_ASSOC);
if($bd_user['status'] == 2)
{
}
else
{
exit;
}
Юзер: @".$bd_user['tg_username']."
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