title: Why am I not able to update data in SQLite database from Python?
body: <p>I am trying to update or rather modify the existing data in the particular cell of a SQLite database from Flask Python. But I can't update. Also I didn't receive any error while doing so. At the same time, I am able to insert a new data in the new row of the table.</p>
  
  <p>Server side code:</p>
  
  <pre><code>@app.route("/")
  @app.route("/&lt;state&gt;")
  def get_post_javascript_data(state=None):
          connection = sqlite3.connect('/home/pi/toggle7.db')
          cursor = connection.cursor()
          load = 'light5'
          status = 'ON'
          if state == 'Load1on':
                  sock.send('Load1ON')
                  print ("sent: Load1ON")
                  try:
                       cursor.execute("UPDATE user1 SET load = 'light5' WHERE id='1'")
                       connection.commit()
                       message = "success"
                  except:
                       connection.rollback()
                       message = "failure"
                  finally:
                       connection.close()
                       print (message)
  </code></pre>