title: using results from a sql query in a python program in another sql query
body: <p>sorry for my previous question which was very ambiguous, but i think if i get the answer to this question I can work it out.
  In the program below i have selected the barcodes of products where the amount is less than the quantity. I want to say, that if the barcodes(in the fridge table) match barcodes in another table(products), set the stock field equal to 0. The problem Im getting is that the program is trying to match all the barcodes that it found in the query against single barcodes in the products table(thats what I think). does anyone know what to do. thanks a million. lincoln.</p>
  
  <pre><code>import MySQLdb
  
  def order():
      db = MySQLdb.connect(host='localhost', user='root', passwd='$$', db='fillmyfridge')
      cursor = db.cursor()
      cursor.execute('select barcode from fridge where amount &lt; quantity')
      db.commit()
      row = cursor.fetchall()
      cursor.execute('update products set stock = 0 where barcode = %s', row)
  </code></pre>