K
K
Kt0T02021-04-25 17:40:43
Python
Kt0T0, 2021-04-25 17:40:43

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:
60857ea5045fe364157940.png
In the database their ID :
60857ed620ee6282901606.png
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

1 answer(s)
Y
Yupiter7575, 2021-04-25
@Kt0T0

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 question

Ask a Question

731 491 924 answers to any question