How to edit radio button in PHP MySQL


How to update a value of radio button in database

In this tutorial you will learn

How to update user’s profile using PHP MySQL(focused radio button)

How to update a value of radio button in database (mysql) using PHP and MySQL Simple Script.

Create database, Create table, insert Values

First create a database name “demo” select database demo.

Create a table “update_radio_button_value”. Insert some data inside table “update_radio_button_value”.

PHP Script Fetch and Show Data

First Connect With Database through MySQL I fetch user’s data and display the data in HTML form field i.e text,email,number and radio button.

all data will display in text filed, email filed and number field using value property except radio button.

For radio button first need to check the value from database then “checked” the radio button.

PHP Script for update user’s data

On this Page retrieve data from previous Page through HTML Form and update the data.

After update the user’s data redirect the user on same page from where he came and show recently updated data.