How to end a while loop when used in a fetch assoc function [closed]

in while($row = $result->fetch_assoc()); semicolon occored issue. replace ; with :

<?php while($row = $result->fetch_assoc()): ?>
       <tr>
          <td><?php echo $row['name']; ?></td>
           <td><?php echo $row['location']; ?></td>
           <td></td>
        </tr>
 <?php endwhile; ?>