title: How to add a text box with the reference count retrieved in the database using javascript?
body: <p>I am trying to create a functionality that will retrieve all the rows with the same ID inside the database and wanted to display it inside a text box. this is the php file for getting all rows:</p>
  
  <p>PHP:</p>
  
  <pre><code>&lt;?php
      include_once('pConfig.php');
      if (!isset($ciCODe)){
          $ciCode = $_GET['cID'];
      }   
      $strSQL = "SELECT * FROM csi_contact_info WHERE ci_ID = '$ciCode'";
      $result = mysqli_query($db, $strSQL);
      if (!$result) {
          printf("Error: %s\n", mysqli_error($db));
          exit();
      }
      $json = mysqli_fetch_all($result, MYSQLI_ASSOC);
      echo json_encode($json);
  ?&gt;
  </code></pre>
  
  <p>After getting all the rows, I want to create a functionality in javascript that will create a textbox referenced on the count of retrieved rows using the code above and show all the retrieved data using the text box.</p>
  
  <p>JAVASCRIPT:</p>
  
  <pre><code>function previewContactInformation(idCode){
          $.ajax({
          type: 'GET',
          url: '../back_php_Code/pPrevContactInfo.php',
          dataType: 'json',
          data: {'cID': idCode},
          contentType: 'application/json; charset=utf-8',
          success: function (response) {
              var cells = eval(response);
              for (var i=0; i &lt;= cells.length ; i ++){
                  '&lt;div class="form-group row"&gt;'
                      + '&lt;div class="col-md-4 col-lg-2"&gt;'
                      + '&lt;label for="name-2" class="block"&gt;First name *&lt;/label&gt;'
                      + '&lt;/div&gt;'
                      + '&lt;div class="col-md-8 col-lg-10"&gt;'
                      + '&lt;input id="name-2" name="name" type="text" class="form-control value =' + cells[i].home_number + ' required"&gt;'
                      + '&lt;/div&gt;&lt;/div&gt;'
              }
          },
           error: function (error) {
              console.log(error);
          }
     });   
  }
  </code></pre>
  
  <p>Is there any way to add dynamically a textbox using javascript referenced to the count of retrieved rows in the database?</p>