Answer the question
In order to leave comments, you need to log in
How to display data for all posts?
Good evening, I’m confused about something, I’m doing a like system for posts in Telegram , which means I get the post ID and write it down in the database, everything works fine, but how can I get the number of likes for different posts from the database, that is, I have 3 -and post:
In the database their ID :
So, how can I display likes for all these posts from the database?
def inline_keyboard(message):
item1 = types.InlineKeyboardButton(text= ' [Тут количество лайков]', callback_data= 'like1')
item2 = types.InlineKeyboardButton(text= ' [Тут количество лайков]', callback_data= 'like2')
markup_inline.add(item1, item2)
bot.send_message(message.chat.id, message.text, reply_markup=markup_inline)
Answer the question
In order to leave comments, you need to log in
Erm... your spreadsheet interface is very similar to PMA which is very strangely associated with python.
sql = 'SELECT likes FROM table'
And then loop through this to each item
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question