I am selecting a value from a table with the code:
cursor.execute("Select _customerPriority FROM _issue where id=7436")
result = cursor.fetchone()
and then outputting the value between html tags like this:
print '<p>'
print "The current status is: %s"%result
print '</p>'
The result that is returned should be a 1,2,3 or 4 but what is actually returned is
The current status is: {'_customerPriority': 1L} or {'_customerPriority': 2L} or {'_customerPriority': 3L} or {'_customerPriority': 4L}
I would also like to create a condition on this value (like 'if result == 4 do something') but I cant get the value out.
I am very new to Python and have been trying all day to extract just the value using different code (like 'for row in result: print "%s"%(row[0]) etc.. but all attempts fail. Can someone kindly point me in the right direction. Thanks
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I am selecting a value from a table with the code:
cursor.execute("Select _customerPriority FROM _issue where id=7436")
result = cursor.fetchone()
and then outputting the value between html tags like this:
print '<p>'
print "The current status is: %s"%result
print '</p>'
The result that is returned should be a 1,2,3 or 4 but what is actually returned is
The current status is: {'_customerPriority': 1L} or {'_customerPriority': 2L} or {'_customerPriority': 3L} or {'_customerPriority': 4L}
I would also like to create a condition on this value (like 'if result == 4 do something') but I cant get the value out.
I am very new to Python and have been trying all day to extract just the value using different code (like 'for row in result: print "%s"%(row[0]) etc.. but all attempts fail. Can someone kindly point me in the right direction. Thanks