How to redirect to new ID of a url

Started by teasebanksy, 03-23-2019

362
0
How to redirect to new ID of a url
  03-23-2019, 04:24 AM
#1
I'm using flask form. When i run the code below to paste the new data to test.html, it returned the url of '/team1/test/[0]' but not '/team1/test/1'. Please help. Thanks.

@application.route('/team1/test/<mid>')
def result(mid):
cursor = g.db_conn.cursor()
sql_stmt = """
SELECT  id, first_name, last_name, grade from table1
where id = %s;
"""
scores = [dict(id=row[0], first_name=row[1], last_name=row[2]) for row in      cursor.fetchall()]
if len(scores) > 0:
    score = scores[0]
else:
    score = None
cursor.execute(sql_stmt, (id,))

« Next Oldest | Next Newest »


Possibly Related Threads…
Thread Author Replies Views Last Post
[Nulled] Premium URL Shortener v5.9.7 lokjhow 2 218 04-28-2021, 10:18 AM
Last Post: josecarlosemporio
What is the best URL Shortener PHP Script of your choice? zeroday 2 151 12-03-2020, 03:36 AM
Last Post: art3mis37
new Publisher latest version bodef73731 1 132 11-07-2020, 03:59 AM
Last Post: Anonimowyy
Request script LaraUpload new version KinginTamil 0 420 11-16-2019, 11:26 AM
Last Post: KinginTamil
How to Use External Image url as Featured Image in WordPress? camygirl 3 741 07-31-2019, 08:35 AM
Last Post: moonviper890
url shortner website bpersin 2 516 07-10-2019, 08:02 PM
Last Post: Divsigned



1 Guest(s)