title: How to pass variables to MYSQL using Python
body: <p>I am using MYSQL (ver. 5.5.31-0+wheezy1) and python (ver. 2.7.3) with the following statement:</p>
  
  <pre><code>q ="""INSERT INTO scale_equipment truck_id, product_id, driver_id, field_id, pit_id, harvest_equipment_id, weight, status VALUES (%s, %s, %s, %s, %s, %s, %s, %s)""",(truck_id, product_id, driver_id, field_id, pit_id, harvest_equipment_id, 0, status)
  </code></pre>
  
  <p>If I use:</p>
  
  <pre><code>q ="""INSERT INTO scale_equipment truck_id, product_id, driver_id, field_id, pit_id, harvest_equipment_id, weight, status VALUES ('002', 'CS', 'BG', 'HD1', 'T1', 'C1', 0, 'U')"""
  </code></pre>
  
  <p>it works fine, what I am I doing wrong to pass the variables in the SQL statement</p>
  
  <p>I print out the q before it hits the execute query statement using the variables and this is what it looks like:</p>
  
  <pre><code>'INSERT INTO scale_equipment truck_id, product_id, driver_id, field_id, pit_id, harvest_equipment_id, weight, status VALUES (%s, %s, %s, %s, %s, %s, %s, %s)', ('002', 'CS', 'BG', 'HD1', 'T1', 'C1', 0, 'U')
  </code></pre>
  
  <p>Any help would be greatly appreciated. </p>