Python 3.4 - passing information from mysql query output table to other page

I have a table (python code below) which prints out the results of a database query.  An image of the output table is also attached.

I need the NOM column to be 'live' so that the user can click on a name and be sent to another page - AND to have the persons MemberID also sent to that page. I've done this in  the past using coldfusion - which looks like this

<td><a href="actionPage.cfm?[b]memberID[/b]= #recordset1.[b]memberID[/b]#">#recordset1.[b]nom[/b]#</a></td>

Open in new window


My problem is to apply this structure to the python format as shown in the code below. Researched it on line but can't find any info.

Thanks for any help.



python table code

def displayAll_names(all_names):
      print("<table border='1'>")
      print("<tr bgcolor=#FCFFDA>")
      print("<th>Member_ID</th>")
      print("<th>civilities</th>")
      print("<th>Nom</th>")
      print("<th>PreNom</th>")
      print("<th>adresse</th>")
      print("</tr>")
      color = 1
      for each in all_names:
            if color is 1:
                  print("<tr bgcolor=#BED3BE>")
            else:
                  print("<tr bgcolor=#D0F5CF>")
            print("<td>{0}</td>".format(each[0]))
            print("<td>{0}</td>".format(each[1]))
           [b] print("<td>{0}</td>".format(each[2]))[/b] ================>  needs changing
            print("<td>{0}</td>".format(each[3]))
            print("<td>{0}</td>".format(each[4]))
            print("</tr>")
            if color is 1:
                  color = 0
            else:
                  color = 1

      print("</table>")	        
     

Open in new window





TABLE OUTPUT FROM DATABASETABLE OUTPUT FROM DATABASE
jameskaneAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

clockwatcherCommented:
We'd need to know the link that you want to go to but...

print('<td><a href="somepage.py?memberId={member_id}">{member_name}</a></td>'.format(member_id=each[0], member_name=each[2]))

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
jameskaneAuthor Commented:
Fantastic - got the live links on the names - just like coldfusion !!

jim
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
MySQL Server

From novice to tech pro — start learning today.