Select data from MySQL database and make it a value using Python -


i using python 2.7 , mysqldb. have created table called table1 has 2 fields (id, id2).

-id field -234 -490 -678 -566 -569  -id2 field -10 -29 -78 -46 -59 

i want script make row's id2 variable(value) in order send email or print it. there specific reason why want value. example, want select row id=678, , automatically id2 of row variable, variable can use in other lines of script.

use execute run mysql select command:

db.execute("select id2 my_table id = '%s';" % user) 

(user id want select from)

edit: yes, need follow data = cursor.fetchall()!


Comments

Popular posts from this blog

android - MPAndroidChart - How to add Annotations or images to the chart -

javascript - Add class to another page attribute using URL id - Jquery -

firefox - Where is 'webgl.osmesalib' parameter? -