title: retriveing data from MySQL into Python 2.7
body: <p>I have the following code:</p>
  
  <p>I have a query which gives me result from MySQL:</p>
  
  <pre><code>import MySQLdb
  db_mysql=MySQLdb.Connect(user=...,passwd=...,db=..., host=...)
  cur = db_mysql.cursor(MySQLdb.cursors.DictCursor)
  cur.execute ("""SELECT X,Y,Z FROM tab_a""")
  for row in crs.fetchall () :
       do things...
  </code></pre>
  
  <p>X is defined in MySql as: <code>bigint(20) unsigned</code> .</p>
  
  <p>In python it shows the number with l suffix : <code>1445l</code></p>
  
  <p>according to this <a href="https://stackoverflow.com/questions/11764713/why-do-integers-in-database-row-tuple-have-an-l-suffix">Why do integers in database row tuple have an &#39;L&#39; suffix?</a> it's a normal behavior for python 2.7</p>
  
  <p>The thing is that I need to use X value in other queries so I saved it: <code>save_x = str(row["X"])</code>
  This auto remove the <code>l</code> suffix.</p>
  
  <p>Now, if I do:</p>
  
  <pre><code>cur.execute ("""SELECT A FROM tablx where id='%s'""")%save_x
  </code></pre>
  
  <p>Doesn't work. it says:</p>
  
  <blockquote>
    <p>TypeError: unsupported operand type(s) for %: 'long' and 'str'</p>
  </blockquote>
  
  <p>How can I make it work?
  I know that it doesn't work beacsue i'm comparing long with string, but if I leave it as a number it stays with L suffix and this also doesn't work.</p>
  
  <p>What can I do to fix it?</p>