title: I want display image_url in php codeigniter using json array
body: <p>The below code is json objects through database field values . How to display image in json the code is correct or not please verify it </p>
  
  <pre><code>$('#radio').one("click", function () {
      //    alert($(this).attr('id'));  //--&gt;this will alert id of checked checkbox.
      if (this.checked) {
  
          $.ajax({
              method: "GET",
              url: "&lt;?php echo base_url(); ?&gt;index.php/secondpage/location",
              dataType: 'json',
  
              success: function (data) {
                  console.log(data);
                  var jsonObj = data;
  
                  $('#tbody').append('');
                  n = jsonObj.hotels.length;
                  for (i = 0; i &lt; n; i++) {
  
                      var eachrow = "&lt;tr&gt;"
                          + "&lt;td&gt;" + jsonObj.hotels[i].name + "&lt;/td&gt;"
                          + "&lt;td&gt;" + jsonObj.hotels[i].location + "&lt;/td&gt;"
                          + "&lt;td&gt;&lt;img src='" + jsonObj.hotels[i].image_url + "'&gt;&lt;/td&gt;"
                          + "&lt;/tr&gt;";
                      $('#tbody').append(eachrow);
                  }
              }
          });
      }
  });
  </code></pre>
  
  <p>The above code is javascript to display database values in table format .
  then it displaying same as it is content but i want image also but it not displaying how to add image path to json table fields</p>