I have a table made in php and inside that table I show some content from my database. I have created a simple button (similar to like) in every td and I want it to increase by 1 with every hit. Here is the line with the button:
echo "<tr align=\"center\">
<td>$nameTemp</td>
<td>$categoryTemp</td>
<td>$textTemp</td>
<td>$likesTemp <input type= 'submit' value='like' name='likes'></td>
<td>$usernameTemp</td>
<td> <button type=\"button\" style=\"cursor:pointer\" onclick=\"openWindow('$multimediaTemp','div1')\">View me</button> </td>
</tr>
";
$likesTemp is the total likes var
I made you a sample of what you needed :
(The variable will be incremented each time the submit button is pressed).
Code :