Непонятные действия скрипта
5 USDЕсть скрипт а именно
$users = $this->query("SELECT * FROM `users`");
if ($this->num_rows($users)) {
$chat_id = 1;
while ($user = $this->fetch($users)) {
if($user["chat_id"] != $chat_id) {
$this->telegram->sendMessage(['chat_id' => $this->chat_id, 'text' => $user["chat_id"], 'parse_mode' => 'HTML']);
$this->telegram->sendMessage(['chat_id' => $user["chat_id"], 'text' => $this->text, 'parse_mode' => 'HTML']);
$chat_id = $user["chat_id"];
}
}
$text = "Сообщения успешно отправлены!";
$this->telegram->sendMessage(['chat_id' => $this->chat_id, 'text' => $text, 'parse_mode' => 'HTML']);
}
в итоге смс никому не доходят а мне в личку спамит один и тот же chat_id
хотя
while
должен был бы дать следующего юзера, скину оплату чеком bitcoin
-
1118 21 0 1 Приветствую!
Заинтересован в сотрудничестве.
Для обсуждения деталей (сроки и бюджет) - пишите в лс.
-
2940 32 0 Здравствуйте. Решу проблему. Пишите в ЛС. Меня зовут Виктор.
-
1 day5 USD
253 3 0 1 day5 USDОтправку сообщения нужно обернуть в try...catch. Скорее всего вылетает с ошибкой на каком-то пользователе. Плюс, не забывайте, что бот может слать не больше 30 сообщений в секунду.
-
А если вместо
$this->fetch($users)
попробовать
$this->fetch_assoc($users)
-
$result = $this->query("SELECT * FROM `users`"); while ($row = $result->fetch_assoc()) { отправка }
Попробуйте мб так
-
Отправку сообщения нужно обернуть в try...catch. Скорее всего вылетает с ошибкой на каком-то пользователе.
-
fetch_array
-
if($user["chat_id"] != $chat_id) {
выполнится если у пользователя не равно 1.
если у пользователей другой но одинаковый, то выполнится один раз.
И что за переменные $this->chat_id?
Они определены? -
Человек сайтом ошибся, нужно на форум программистов тогда а не создавать задачу и выкатывать ее решение в обсуждение
-
Current freelance projects in the category PHP
"Magento 2.4.6 adding a product through attributes"Problem: The website has many products that can be sold together with other products. Products need to be added through an attribute in the configuration product. For example: A computer mouse is available in different colors, and a mouse pad can be purchased with it (although… PHP, Web programming ∙ 2 proposals |
Разработать скрипт под WordPress CMS + Google maps API + MySQLWe need a code for a WordPress website. The current (demo) website https://e-ztrans.com/ is based on some self-made CMS. We are trying to override and make it more reliable. I will provide access to current website’s admin panel as well as source code of the current data base… PHP, Web programming ∙ 3 proposals |
Add a section to the website
76 USD
1. Add section https://www.vitajuwel.us/sana to the website https://vitajuwel.com.ua/ 2. Fix the central slider. Website on Laravel. Page speed score should not decrease. PHP ∙ 3 proposals |
Calculator for calculating the cost per m2 for a blinds websiteHello everyone, I need to create a calculator for calculating the cost of a product based on its width and height. Calculation example: Horizontal blinds 0.75 m2Fabric roller blinds 0.60 m2Mosquito nets 0.75 m2Roman blinds 1 m2Japanese blinds 0.60 m2Protective roller blinds 1.3… JavaScript, PHP ∙ 11 proposals |
Stylize Select option WordpressTask to style the standard Select option with appropriate styles. Problem: when using replacement of dropdown with list through jquery: filters for sorting products do not work. JavaScript, PHP ∙ 9 proposals |