A
A
Alexander2018-06-23 09:01:58
PHP
Alexander, 2018-06-23 09:01:58

How to make an entry in mysql through php-telegram-bot?

Good afternoon! Please help me, I am making a telegram bot with entering answers in Mysql.
Unable to write entered data to table.
There are two tables users and doc
The users table consists of id | name | chat_id
The doc table consists of id | data | doc1 | doc2| doc3 | user_id
At the first interaction with the bot, the user is recorded in the users table, then he is prompted to enter the name of the documents doc1, doc2, doc3 sequentially.
The question is how to implement a record in the doc table with the assignment of user_id (doc) which is equal to id (users) so that it would be consistent.
Example script:
bot:
(inline button) enter data
\\user clicks
bot: enter first title
user: blablabla1
bot: enter second name
user: blablabla2
bot: enter third name
user: blablabla3
bot: you entered blablabla1, blablabla2, blablabla3
bot:
(inline button) enter data
The result should be:
id | data | doc1 | doc2 | doc3 | user_id
1 | 01/01/2018 | Title 1 | Title 2 | Title 3 | 2

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question