vendredi 13 mars 2015

display the last row of html table with edit button/link


Vote count:

0




I have an html table, using while loop, it will echo all the result.


But for the last row, i want to add an edit button. Simplified code is as below:



echo '<table>';
while($row = mysqli_fetch_assoc($result))
{
echo '<tr>';
echo '<td>'.$row['name'].'</td>';
echo '<td>'.$row['age'].'</td>';
echo '<td>'.$row['sex'].'</td>';
echo '<td>'.$row['desc'].'</td>';
echo '<td>'.$row['remark'].'</td>';
echo '<td><a href="edit.php?id='.$row['id'].'">EDIT</a>';
echo '<tr>';
}
echo '</table>';


As you can see, the codes will print out 'EDIT' link in all the last column of each row. I just want it to print in the last row. How can i achieve it? Thanks in advance.



asked 1 min ago







display the last row of html table with edit button/link

Aucun commentaire:

Enregistrer un commentaire