How to pass data Table to Modal in php?

Viewed 19

Hello i use bootsrtap and custom css to fronted also i create one code from table to edit user info in table row last is setting icon there user click and get their edit option but unfortunatly there only one id is set help below my code

<table class="table table-borderless rounded-sm  mt-3" style="overflow: hidden;">
<tbody>
       <?php foreach($data->$data as $row): ?>
         <tr>
            <td href="<?= url('update/' . $row->id) ?>">Name</td>
                                
           <td class="d-flex justify-content-end"><a href="#" data-menu="menu-edit"> Edit </a> </td>
    
         </tr>
      <?php endforeach ?>
  </tbody>
</table>

when click on edit -> modal appear

my modal code

<div id="menu-edit" 
         class="menu menu-box-modal rounded-m" 
         data-menu-height="350" 
         data-menu-width="350">
        <div class="menu-title">
            <p class="color-highlight">Setting</p>
            <h1 class="font-24"> <?= $row->name ?> </h1>
            <a href="#" class="close-menu"><i class="fa fa-times-circle"></i></a>
        </div>
        <div class="me-3 ms-3 mt-3">
            <div class="list-group list-custom-small">
                
          <a href="<?= url('update/' . $data->id) ?>"><span> Update </span></a>
         <a href="<?= url('delete/' . $data->id) ?>" ><span> Delete </span></a>
            </div>
            
        </div>
    </div>

but problem is my tabel data is about 5 rows when i click any one id is same

how to get multiple id from their ??

0 Answers
Related