title: Can we display data on click in modal popup? Please assist how it can be done using CodeIgniter
body: <p>I am developing a blog using Codeigniter where the details are being displayed in a bootstrap card with the &quot;Read More&quot; feature. The code is fetching data dynamically and is displaying all the details in the card, but once clicking on 'Read More' it is only displaying the first row data. What can be done to fetch the particular row data in modal popup against which the Read More button is clicked?
  Here is the code for fetching the data and displaying in card:</p>
  <pre><code>&lt;div class=&quot;row clearfix&quot;&gt;
  
  &lt;?php 
      $query = $this-&gt;db-&gt;query(&quot;SELECT * FROM services_offered LIMIT 15&quot;);
      foreach ($query-&gt;result() as $row) {
          echo &quot;&lt;div class='col-lg-4 bottommargin-sm'&gt;&quot;;
          echo &quot;&lt;div class='feature-box media-box fbox-bg'&gt;&quot;;
          echo &quot;&lt;div class='fbox-media'&gt;&quot;;
          echo &quot;&lt;a href='#'&gt;&lt;img src='$row-&gt;swo_images' alt='Featured Box Image' style='height:250px; width:450px;'&gt;&lt;/a&gt;&lt;/div&gt;&quot;;
          echo &quot;&lt;div class='fbox-content fbox-content-lg'&gt;&quot;;
          $string = $row-&gt;swo_brief_intro;
          $string = word_limiter($string, 15);
          echo &quot;&lt;h3 class='nott ls0 font-weight-semibold'&gt;$row-&gt;swo_image_heading&lt;span class='subtitle font-secondary font-weight-light ls0'&gt;$string&lt;/span&gt;&lt;/h3&gt;&quot;;
          echo &quot;&lt;a href='#' class='button-link border-0 color btn-edit' data-toggle='modal' data-target='#whatwedo'&gt;Read More&lt;/a&gt;&quot;;
          echo &quot;&lt;/div&gt;&quot;;
          echo &quot;&lt;/div&gt;&quot;;
          echo &quot;&lt;/div&gt;&quot;;
          // section for modal starts here
          echo &quot;&lt;div class='modal fade' id='whatwedo' tabindex='-1' aria-labelledby='exampleModalLabel' aria-hidden='true'&gt;&quot;;
          echo &quot;&lt;div class='modal-dialog'&gt;&quot;;
          echo &quot;&lt;div class='modal-content'&gt;&quot;;
          echo &quot;&lt;div class='modal-header'&gt;&quot;;
          echo &quot;&lt;h5 class='modal-title' id='exampleModalLabel'&gt;$row-&gt;swo_image_heading&lt;/h5&gt;&quot;;
          echo &quot;&lt;button type='button' class='close' data-dismiss='modal' aria-label='Close'&gt;&quot;;
          echo &quot;&lt;span aria-hidden='true'&gt;&amp;times;&lt;/span&gt;&quot;;
          echo &quot;&lt;/button&gt;&quot;;
          echo &quot;&lt;/div&gt;&quot;;
          echo &quot;&lt;div class='modal-body'&gt;&quot;;
          echo &quot;&lt;/div&gt;&quot;;
          echo &quot;&lt;div class='modal-footer'&gt;&quot;;
          echo &quot;&lt;button type='button' class='btn btn-secondary' data-dismiss='modal'&gt;Close&lt;/button&gt;&quot;;
          echo &quot;&lt;button type='button' class='btn btn-primary'&gt;Save changes&lt;/button&gt;&quot;;
          echo &quot; &lt;/div&gt;&quot;;
          echo &quot;&lt;/div&gt;&quot;;
          echo &quot;&lt;/div&gt;&quot;;
          echo &quot;&lt;/div&gt;&quot;;
  
          // section for modal starts here
      }
  ?&gt;  
  </code></pre>
  
  <p>What else it could be possible with? Please assist. Thankyou</p>