title: How to store data into database using PyMYSQL in python
body: <p>I am scraping a website and getting the companies details from it, Now I trying  to store the data into database. But I am getting some error like </p>
  
  <pre><code>raise InternalError(errno, errorvalue)
  pymysql.err.InternalError: (1054, "Unknown column 'companyaddress' in 'field list'")
  </code></pre>
  
  <p>Here is my code</p>
  
  <pre><code>for d in companydetail:
      lis = d.find_all('li')
      companyname = lis[0].get_text().strip()
      companyaddress = lis[1].get_text().strip()
      companycity = lis[2].get_text().strip()
  try:
     companypostalcode = lis[3].get_text().strip()
     companypostalcode = companypostalcode.replace(",","")
  
  except:
     companypostalcode = lis[3].get_text().strip()
  try:
     companywebsite = lis[4].get_text().strip()
  except IndexError:
     companywebsite = 'null'
  print (companyname)                          
  print (companyaddress)
  print (companycity)
  print (companypostalcode)
  print (companywebsite)
  try:
     with connection.cursor() as cursor:
     print ('saving to db')
     cursor.execute("INSERT INTO company(companyname,address,city,pincode,website) VALUES (companyname,companyaddress,companycity,companypostalcode,companywebsite)")
     connection.commit()
     connection.close()                            
  </code></pre>
  
  <p>I am getting my data which I want but it I am not able to store data into database.
  The result which I get while print (companyname) and print (campanyaddress) is :</p>
  
  <pre><code>NINGBO BOIGLE DIGITAL TECHNOLOGY CO.,LTD.
  TIANYUAN INDUSTRIAL ZONE CIXI NINGBO
  ZHEJIANGNINGBO
  315325
  http://www.boigle.com.cn
  </code></pre>