Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PDOStatement::execute(): SQLSTATE[42S02]: Base table or view not found: 1146 Table 'bot.telegram_update' doesn't exist #1415

Closed
iyamk opened this issue Aug 25, 2023 · 2 comments
Labels

Comments

@iyamk
Copy link

iyamk commented Aug 25, 2023

/home/user/bot/vendor/longman/telegram-bot/src/DB.php
Line 233
Error: PDOStatement::execute(): SQLSTATE[42S02]: Base table or view not found: 1146 Table 'bot.telegram_update' doesn't exist
My code:

try {
    $telegram = new Longman\TelegramBot\Telegram($bot_api_key, $bot_username);

    $telegram->addCommandsPaths([
        __DIR__.'/Commands'
    ]);

    $mysql_credentials = [
   'host'     => 'localhost',
   'port'     => 3306,
   'user'     => 'root',
   'password' => '',
   'database' => 'bot'
    ];

    $telegram->enableMySql($mysql_credentials);

    $telegram->handleGetUpdates();
}
catch (Longman\TelegramBot\Exception\TelegramException $e)
{
    writeLog($e->getMessage());
}

What is it and where can I get a database dump?

@iyamk iyamk added the bug label Aug 25, 2023
@jacklul
Copy link
Collaborator

jacklul commented Aug 25, 2023

https://github.com/php-telegram-bot/core/blob/develop/structure.sql

@iyamk
Copy link
Author

iyamk commented Sep 30, 2023

https://github.com/php-telegram-bot/core/blob/develop/structure.sql

How tired I am of this structure already; was it really impossible to do without it? The code works just as quickly both with and without it

@iyamk iyamk closed this as completed Sep 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants