```js
<script type="text/javascript">

function myFunction() {
 //var query = '?';
     var str = $("form").serialize();
    str = str.replace(/\=/g, "='").replace(/\&/g, "'&");
    $( "#results" ).text(str+"'" );  
     var x = $("#results").text();
return x;

}

$('#myButton').on('click',function(){    
    var jsonString = JSON.stringify(myFunction());
    console.log(jsonString);

 $.ajax({
    url: 'insert_value.php',
    data: jsonString,
    contentType: 'application/json; charset=utf-8',
    type: 'POST',
  }).done(function(resp) {
    $('#result').html(resp)

  });
  });  

  </script>
```

```html
<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
   <script src="https://code.jquery.com/jquery-1.10.2.js"></script>
   <link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css" rel="stylesheet" />

</head>
<body>

<?php 
include("con_gen.php");

error_reporting(E_ALL);

// DATABASE CONNECTION AND SELECTION VARIABLES - GET THESE FROM YOUR HOSTING COMPANY
$db_host = "localhost"; // PROBABLY THIS IS OK
$db_name = "idcard";
$db_user = "root";
$db_word = "";

// OPEN A CONNECTION TO THE DATA BASE SERVER AND SELECT THE DB
$mysqli = new mysqli($db_host, $db_user, $db_word, $db_name);

// DID THE CONNECT/SELECT WORK OR FAIL?
if ($mysqli->connect_errno)
{
    $err
    = "CONNECT FAIL: "
    . $mysqli->connect_errno
    . ' '
    . $mysqli->connect_error
    ;
    trigger_error($err, E_USER_ERROR);
}

// RUN A QUERY
$result = mysqli_query($mysqli,"SELECT value FROM combo1");
$num_rows = mysqli_num_rows($result);

//echo "$num_rows Rows\n";
if ($result->num_rows > 0) {
     // output data of each row
  $array = Array();
  $array1 = Array();
     while($row = $result->fetch_assoc()) {
         //echo "<br> value: ". $row['value'].  "<br>";
          $array[] = $row['value'];

}
//print_r($array);

$sql = "SELECT static_name FROM static_values";
$result = mysqli_query($mysqli, $sql);
if ($result && mysqli_num_rows($result) > 0) 
 while($row = mysqli_fetch_array($result)){
                //echo "<option>" . $row['static_name'] . "</option>";
                $array1[]=$row['static_name'];

                 //echo $source;
               }
              // print_r($array1);
               foreach ($array as $row)
{
  if(in_array($row, $array1))
  {
$sql = "SELECT source_table,Alias_name FROM static_values where static_name='$row'";
$res = $mysqli->query($sql);

// DID THE QUERY WORK OR FAIL?
if (!$res)
{
    $err
    = 'QUERY FAILURE:'
    . ' ERRNO: '
    . $mysqli->errno
    . ' ERROR: '
    . $mysqli->error
    . ' QUERY: '
    . $sql
    ;
    trigger_error($err, E_USER_ERROR);
}

// ARE THERE ANY ROWS IN THE RESULTS SET

if ($res->num_rows == 0)
{
    trigger_error("ERROR: NO DATA FOUND BY $sql", E_USER_ERROR);
}

// RETRIEVE THE ROWS INTO AN ARRAY OF HTML STATEMENTS
//$html = "";
echo '<form method="POST" action="" id="myform">';

while ($row = $res->fetch_object())
{
    //$html =$html.' 
  echo'
<tr>
  <td>
    <div class="row-fluid">

      <div class="span3 bgcolor">
     <label>'.$row->Alias_name.'</label>

        <select  id='.$row->source_table.' name='.$row->source_table.' data-live-search="true" class="selectpicker form-control" type="sel">';

  /*foreach ( $Data->{$row->source_table} as $key =>$item) {
    echo "<option value=".$key.">".$item."</option>" ;
  }*/
   foreach ( $Data->{$row->source_table} as $key =>$item)  {
    echo "<option value=".$key.">".$item."</option>";
  }
echo '         
          </select> 
                                          </div>
      </div>
  </td>
</tr>';
}
}
else if($row=="Image")
{
  echo '
<tr>
  <td>
   <div class="row-fluid">

            <div class="span3 bgcolor">
            <label>'.$row.'</label>
               <label>'.$row.'</label>
               <input type="file" name="'.$row.'" id="'.$row.'" onchange="document.getElementById(\''.$row.'\').value = this.value">
                <input type="text" name="'.$row.'" id="'.$row.'" value="'.$imagepath.'">

</div>
</div>
  </td>
</tr>';
   }
   else
   {
   //$html =$html.' 
  echo '
<tr>
  <td>
   <div class="row-fluid">

            <div class="span3 bgcolor">
            <label>'.$row.'</label>
                 <input id='.$row.' type="text" placeholder=" Enter Value " name='.$row.' style="width:100%" class="form-control" required="" />

                </select> 
</div>
</div>
  </td>
</tr>';

}

}
echo'<input  id="myButton" type="button" value="SUBMIT" class="btn btn-success"  name="submit" onclick="myFunction();"/>';
echo '<p id="results">&nbsp;</p>';
echo '<pre id="result"></pre></form> ';

//echo '<p><tt id="results"></tt></p>';
}

               ?>
               </body>
</html>
```

```html
<?php else if($row=="Image")
{
    echo '<tr>
             <td>
                <div class="row-fluid">
                    <div class="span3 bgcolor">
                        <label>'.$row.'</label>
       <input type="file" name='.$row.' id='.$row.' onchange="document.getElementById('.$row.').value = this.value">
    <input type="text" name='.$row.' id='.$row.'>
       </div>
  </div>
      </td>
 </tr>';
?>
```

Here I'm reading image full path within textbox and inserting into database but here image path is not coming into textbox please tell me solution

I posted my whole code please let me know the solution how to get image path into text box