I have a table with a date, ID1, ID2 score1 and score2. I am trying to update one row through php when the user has entered the specific date and id's in an html form. I have validated all the user entries. When I run my query it updates all rows in the table instead of just one. Here is a snippet of my code:
include('connect.php');
$q = mysqli_query($dbc, "SELECT * from Game");
while ($row =mysqli_fetch_array($q, MYSQLI_ASSOC))
{
mysqli_query($dbc, "UPDATE Game SET score1 ='".$points1."', score2='".$points2."'
WHERE '".$date."' = '".$row['Date']."' AND '".$id."' = '".$row['ID1']."' ");
}
mysqli_close($dbc);