yuka libres yuka libres - 5 days ago 7
HTML Question

Directing page and making table row clickable inside php

I would like to know how to make a table row clickable and for it to direct to other page.

<?php
while( $row = $result->fetch_assoc()){
echo
"<tr>
<td>{$row['id']}</td>
<td>{$row['fname']} {$row['lname']}</td>
<td></td>
</tr>\n";

?>


I looked for other answers here at stack, and I tried the OnClick but it doesn't work and i get errors. Thanks in advance for the help.

Answer

Just use the html anchor tag

 <?php
          while( $row = $result->fetch_assoc()){
            echo
            "<tr>
              <td>{$row['id']}</td>
              <td>{$row['fname']} {$row['lname']}<a href="your_direction" style="display: block"></a></td>
              <td></td>
            </tr>\n";
    ?>
Comments