title: multidimensional array to database in python
body: <p>I am trying to figure out a way to put a two dimensional array (using python) into an sqlite database. My array:</p>
  
  <pre><code>['hello', 'hello', 'hello'], ['hello', 'hello', 'hello']
  </code></pre>
  
  <p>What I want is for each tuple of 'hello's would a new row with each 'hello' being its own attribute. I'm not sure what I'm trying to do is even possible (I hope it is). I tried following a few other posts but I keep getting the error:</p>
  
  <pre><code>sqlite3.InterfaceError: Error binding parameter 0 - probably unsupported type.
  </code></pre>
  
  <p>Does anyone know how to insert a multidimensional array into a sqlite database? Any help would be appreciated. Here is my code:</p>
  
  <pre><code>import sqlite3
  
  array2d = [['hello' for x in xrange(3)] for x in xrange(3)] 
  
  var_string = ', '.join('?' * len(array2d))
  
  conn = sqlite3.connect('sample.db')
  c = conn.cursor()
  
  c.execute('''CREATE TABLE sample (Name TEXT, Line_1 TEXT, Line_2 TEXT)''')
  
  query_string = 'INSERT INTO sample VALUES (%s);' % var_string
  
  c.execute(query_string, array2d)
  </code></pre>