Quantcast
Channel: MySQL Forums - Connector/Python
Viewing all articles
Browse latest Browse all 384

How to execute SELECT command with WHERE clause (1 reply)

$
0
0
I am using Python 3.1 and MySQL 5.0.
My python code is,

cursor.execute("SELECT Gene_name FROM cneviewer WHERE CNE_ID = 'CNS' " )

cneviewer is my database name and I have assigned a value to the variable CNS as,
CNS=sequence.split("_")[0]

When I execute this query it doesnot return any rows. When I print number of rows it says -1.
Can somebody help me pls?

Viewing all articles
Browse latest Browse all 384

Trending Articles