$friendRequests = ("SELECT * FROM zahtjevi_prijatelja WHERE user_to='".$_SESSION['ID']."'");
$res = mysql_query($friendRequests) or die(mysql_error());
if (mysql_num_rows($res) ==0) {
echo "You have no friend Requests at this time.";
$user_from = "";
}
else
{
while ($get_row = mysql_fetch_assoc($res)) {
While return all friend requests ,and create form for every request. Form is in while-loop. What i want to do is that if I press submit button for one of requests that i get, add only for pressed to database, but in my case all requests are added. Its because form name is always the same in while-loop so i need some how dynamically change name of form if there is more friend requests.
<form action="friendRequest.php" method="post" id="myForm"
enctype="multipart/form-data">
<input type="submit" name="acceptrequest" value="Accept Request">
<input type="submit" name="ignorerequest" value="Ignore Request"><br>
</form>
<?php
}
?>