I'm fairly new to php and I know the question has been asked a lot, but please bear with me. I've managed to populate an html table with a mySql database. At the end of each row is a check in button that resets the date on the row. My question is how, can I keep track of which row the button belongs too so I know to only update that row?
I have an ID on each row so I know I can use that when updating to the table, but I'm just uncertain how to associate each button to it's respective row. Here's a snippet:
while ($row = mysql_fetch_array($result)) {
echo "<tr>";
echo "<td class='text-left'>".$row[card_id]</td>";
echo "<td class='text-left'>".$row[status]</td>";
//current student
echo "<td class='text-left'>".$row[user_id]."</td>";
echo "<td class='text-left'>".$row[end_date]."</td>";
//Early Check In button
echo "<td class='text-left'><button class='checkInBtn'></button></td>";
echo "</tr>";
}