if call.data == 'stars':
photo = call.message.text
con = sqlite3.connect("database.db")
cursor = con.cursor()
cursor.execute(f'INSERT INTO stars (photo, star) VALUES (photo, 1) ON CONFLICT (photo) DO UPDATE SET star = star + 1')
con.commit()
cursor.execute('SELECT star FROM stars WHERE photo = :photo', {'photo' : photo} )
star = cursor.fetchone()
con.commit()
markup = telebot.types.InlineKeyboardMarkup()
markup.add(telebot.types.InlineKeyboardButton(text=f'Рейтинг - ⭐{star}', callback_data="stars"))