Fuck1nRetarded
Social Media Trend Analyst
Divine
2
MONTHS
2 2 MONTHS OF SERVICE
LEVEL 1
400 XP
In this tutorial I will you will learn about updates and how to save data in Mysql , display the information from MySQL, and most important How to update radio button, Checkbox and dropdown list in PHP and MySQL.This simple updating using radio button, checkbox and dropdown list in PHP and MySQL. This project creates a registration query through the form and automatically connect in the mysql to create database. And you can update and delete the data even if you are not in the database. I will show you the example code below.
Sample Code
Registration Form
Update - Registration Form
Database Configuration
For more tutorials just visit this website @www.sourcecodester.com and don't forget to Like and Share. Enjoy Coding.
Download
Sample Code
Registration Form
- <script type="text/javascript">
- function deletes(id)
- {
- if(confirm('Sure To Remove This Record ?'))
- {
- window.location.href='delete.php?id='+id;
- }
- }
- </script>
- <h1 align="center">Update - Registration Form</h1>
- <?php
- include
(
'config.php'
)
;
- extract
(
$_POST
)
;
- if
(
isset
(
$save
)
)
- {
- $que
=
mysql_query
(
"select email from student where email='$email
'"
)
;
- $row
=
mysql_num_rows
(
$que
)
;
- if
(
$row
)
- {
- echo
"<font color='red'>This email id is alredy exists</font>"
;
- }
- else
- {
- $hob
=
implode
(
","
,
$arr
)
;
- mysql_query
(
"insert into student values('','$n
','$e
','$m
','$gen
','$hob
','$cou
',now())"
)
;
- echo
"<font color='blue'>Records saved</font>"
;
- }
- }
- echo
"<table border='1'>"
;
- echo
"<tr><th>Student_Id</th><th>Name</th><th>Email</th><th>Mobile Number</th><th>Gender</th><th>Hobbies</th><th>Country</th><th>Registered Date</th><th>Delete</th><th>Update</th></tr>"
;
- $que
=
mysql_query
(
"select * from student"
)
;
- while
(
$obj
=
mysql_fetch_object
(
$que
)
)
- {
- echo
"<tr>"
;
- echo
"<td>"
.
$obj
->
id
.
"</td>"
;
- echo
"<td>"
.
$obj
->
name
.
"</td>"
;
- echo
"<td>"
.
$obj
->
email
.
"</td>"
;
- echo
"<td>"
.
$obj
->
mob
.
"</td>"
;
- echo
"<td>"
.
$obj
->
gender
.
"</td>"
;
- echo
"<td>"
.
$obj
->
hobbies
.
"</td>"
;
- echo
"<td>"
.
$obj
->
country
.
"</td>"
;
- echo
"<td>"
.
$obj
->
regDate
.
"</td>"
;
- ?>
- <td><a href="javascript:deletes(<?php
echo
$obj
->
id
;
?>
)">Delete</a></td>
- <?php
- echo
"<td><a href='update.php?eid=$obj->email
'>Update</a> </td>"
;
- echo
"</tr>"
;
- }
- echo
"</table>"
;
- ?>
Update - Registration Form
Database Configuration
- <?php
- error_reporting
(
1
)
;
- $con
=
mysql_connect
(
"localhost"
,
"root"
,
""
)
or die
(
mysql_error
(
)
)
;
- mysql_select_db
(
"radiodown"
,
$con
)
;
- ?>

For more tutorials just visit this website @www.sourcecodester.com and don't forget to Like and Share. Enjoy Coding.
Download
You must upgrade your account or reply in the thread to view hidden text.