title: How to make row works outside foreach
body: <p>ive made users list and i made when i click on someones name to get info inside modal for specific user. It is working perfect when i put it inside foreach, but the problem is that i have timer that refresh div where all users are, but when i open modal and the div gets refreshed, the modal closes, so thats why i cant put it inside foreach.</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;div id="refresh"&gt;
  &lt;?php $userAll = DB::getInstance()-&gt;query("SELECT * FROM users"); 
  foreach($userAll-&gt;results() as $row){ ?&gt;
  &lt;ul class="list-group list-group-flush"&gt;
      &lt;?php if(strtotime(escape($row-&gt;activity)) &gt; $getActivityTime): ?&gt;
          &lt;li class="list-group-item"&gt;
              &lt;div class="row"&gt;
                  &lt;div class="col d-flex justify-content-start align-items-center"&gt;
                      &lt;a href="#" class="text-dark text-decoration-none" data-bs-toggle="modal" data-bs-target="#profileModal&lt;?php echo $row-&gt;id; ?&gt;"&gt;&lt;?php echo escape($row-&gt;username) ?&gt;&lt;/a&gt;
                  &lt;/div&gt;
              &lt;/div&gt;
          &lt;/li&gt;
      &lt;?php endif; ?&gt;
  &lt;/ul&gt;
  &lt;?php } ?&gt;
  &lt;/div&gt;
  
  &lt;!-- Profile Modal --&gt;
  &lt;div class="modal fade" id="profileModal&lt;?php echo $row-&gt;id; ?&gt;" tabindex="-1" aria-labelledby="profileModalLabel" aria-hidden="true"&gt;
      &lt;div class="modal-dialog modal-xl modal-dialog-centered"&gt;
          &lt;div class="modal-content"&gt;
              &lt;div class="modal-header"&gt;
                  &lt;h5 class="modal-title" id="profileModalLabel"&gt;Profile&lt;/h5&gt;
                  &lt;button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"&gt;&lt;/button&gt;
              &lt;/div&gt;
              &lt;div class="modal-body"&gt;
                  &lt;?php echo escape($row-&gt;username) ?&gt;
              &lt;/div&gt;
              &lt;div class="modal-footer"&gt;
                  test
              &lt;/div&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>