title: Show Sqlite Column data in drop down Javascript or Jquery
body: <p>am trying to load all the data of the sqlite column name Phone to a dropdown so what ever the data is inserted into the database the same data after insert the when the row data is presented the on same the the data is to be filled in the dropdown as a option am not able to present the "Phone" Column data into drop down</p>
  
  <p><a href="http://jsfiddle.net/JpquX/15/" rel="nofollow">JS Fiddle Demo</a>  </p>
  
  <p>HTML:</p>
  
  <pre><code>&lt;input type="hidden" id="id" /&gt;First name:
  &lt;input type="text" id="firstName" /&gt;
  &lt;br/&gt;Last name:
  &lt;input type="text" id="lastName" /&gt;
  &lt;br/&gt;Phone:
  &lt;input type="text" id="phone" /&gt;
  &lt;br/&gt;
  &lt;button class="insert"&gt;Insert&lt;/button&gt;
  &lt;div id="results"&gt;&lt;/div&gt;
  &lt;form&gt;
      &lt;select id="Phonenumberdd"&gt;
          &lt;option value="select Phone number"&gt;select Phone number&lt;/option&gt;
      &lt;/select&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>JS:</p>
  
  <pre><code>var results = $('#results')[0];
  var id = $('#id')[0];
  var firstName = $('#firstName')[0];
  var lastName = $('#lastName')[0];
  var phone = $('#phone')[0];
  
  var createStatement = "CREATE TABLE IF NOT EXISTS Contacts (id INTEGER PRIMARY KEY AUTOINCREMENT, firstName TEXT, lastName TEXT, phone TEXT)";
  var selectAllStatement = "SELECT * FROM Contacts";
  var insertStatement = "INSERT INTO Contacts (firstName, lastName, phone) VALUES (?, ?, ?)";
  
  
  var db = openDatabase("AddressBook", "1.0", "Address Book", 200000);
  var dataset;
  createTable();
  
  function onError(tx, error) {
      alert(error.message);
  }
  
  function showRecords() {
      results.innerHTML = '';
      db.transaction(function(tx) {
          tx.executeSql(selectAllStatement, [], function(tx, result) {
              dataset = result.rows;
              for (var i = 0, item = null; i &lt; dataset.length; i++) {
                  item = dataset.item(i);
                  results.innerHTML += '&lt;li&gt; ' + item['firstName'] + ' -   ' + item['lastName']  + '&lt;/li&gt;';
              }
          });
      });
  }
  
  function createTable() {
      db.transaction(function(tx) {
          tx.executeSql(createStatement, [], showRecords, onError);
      });
  }
  
  function insertRecord() {
      db.transaction(function(tx) {
          tx.executeSql(insertStatement, [firstName.value, lastName.value, phone.value], loadAndReset, onError);
      });
  }
  
  
  
  function loadAndReset() {
      resetForm();
      showRecords();
  }
  
  function resetForm() {
      firstName.value = '';
      lastName.value = '';
      phone.value = '';
      id.value = '';
  }
  
  
  $('.insert').on('click', insertRecord);
  </code></pre>