Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed

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.

image text in transcribed 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
HOWCOSYS S SSSSSS 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 o HITE 32 33 34 35
1) in
36 37 38 39 40

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Practical Azure SQL Database For Modern Developers Building Applications In The Microsoft Cloud

Authors: Davide Mauri, Silvano Coriani, Anna Hoffma, Sanjay Mishra, Jovan Popovic

1st Edition

1484263693, 978-1484263693

More Books

Students also viewed these Databases questions

Question

why a systems approach is important

Answered: 1 week ago