Skip to content
Advertisement

php table update multiple records at one time

I have a table that retrieves the username and availability status from the users table. Right now in my testing database I have 3 records. If I try to change the availability field for any of them, noting in updated.

This is my availability.php file (the first line keeps getting cut off):

JavaScript

Here is my av_update.php file:

JavaScript

Updating any other field from other forms and inserting and deleting data from all other forms is working properly, so I know it’s not the connection file.

Any help on getting the code to update the table would be greatly appreciated.

Advertisement

Answer

Your form action must go to av_update.php?id=, since you’re getting that value from the $_GET array.

Also, you should sanitize and validate the input data, or otherwise you’re exposing your system to SQL Injection and other kinds of attacks.

User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement