Question
PHP Form Submits But Only Updates Last Row. I am trying to update multiple data in the performance table but only the last row is
PHP Form Submits But Only Updates Last Row.
I am trying to update multiple data in the performance table but only the last row is being updated. In the performance table there are two primary keys. Player Id and Practice number. Each player can have multiple practice numbers. I am trying to update the practice performance data of each player but only the last practice performance data is being updated. Performance table is shown below.
This is the code which is not working and is only updating the last practice data for each player Id:
This is the code for update.php:
include("connection.php");
$query = "update performance set practise_no='$_POST[practise_no]',time='$_POST[time]',points='$_POST[points]' where id = '$_POST[id]' AND practise_no ='$_POST[practise_no]'";
$query_run = mysqli_query($link,$query);
?>
Please tell me what have I done wrong.
score id practise_no laptime 1 1 02:01:19.000000 98 1 2 02:02:14.000000 23 13 02:01:14.000000 74 2 1 02:01:14.000000 34 HTT 36 37 38 39 40Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started