PHPMYSQL code/script for updating a website form
<?php
session_start();
//error_reporting(0);
$datep=date("d-m-Y h:i:A");
include("db.php");
//$surname=$_POST['surname'];
$user_id=$_POST['user_id'];
$faculty=$_POST['faculty'];
$dept=$_POST['dept'];
$course=$_POST['course'];
$level=$_POST['level'];
$sex=$_POST['sex'];
$phone=$_POST['phone'];
$address=$_POST['address'];
$nok=$_POST['nok'];
$nokphone=$_POST['nokphone'];
$username=$_POST['username'];
$nokaddress=$_POST['nokaddress'];
if($faculty==""||$dept==""||$course==""||$level==""||$phone==""||$address==""||$nok==""||$nokphone==""||$nokaddress=="")
{
$message="Incomplete Information, Fill All Fields";
include("editp.php");
exit();
}
$sql="UPDATE application SET faculty='$faculty',dept='$dept',course='$course',level='$level',phone='$phone',address='$address',nok='$nok',nokphone='$nokphone',nokaddress='$nokaddress' WHERE user_id='$user_id'";
mysql_query($sql) or die (mysql_error());
$message="Successfully Updated";
header("location:editp.php?message=$message&&id=$user_id");
exit;
?>
To use this code make sure the database name is changed to your own database name.
Submit your E-mail for further update or go to dkingsnet.blogspot.com to see other information which you are not seeing here. like our facebook page to chat with the admin.
<?php
session_start();
//error_reporting(0);
$datep=date("d-m-Y h:i:A");
include("db.php");
//$surname=$_POST['surname'];
$user_id=$_POST['user_id'];
$faculty=$_POST['faculty'];
$dept=$_POST['dept'];
$course=$_POST['course'];
$level=$_POST['level'];
$sex=$_POST['sex'];
$phone=$_POST['phone'];
$address=$_POST['address'];
$nok=$_POST['nok'];
$nokphone=$_POST['nokphone'];
$username=$_POST['username'];
$nokaddress=$_POST['nokaddress'];
if($faculty==""||$dept==""||$course==""||$level==""||$phone==""||$address==""||$nok==""||$nokphone==""||$nokaddress=="")
{
$message="Incomplete Information, Fill All Fields";
include("editp.php");
exit();
}
$sql="UPDATE application SET faculty='$faculty',dept='$dept',course='$course',level='$level',phone='$phone',address='$address',nok='$nok',nokphone='$nokphone',nokaddress='$nokaddress' WHERE user_id='$user_id'";
mysql_query($sql) or die (mysql_error());
$message="Successfully Updated";
header("location:editp.php?message=$message&&id=$user_id");
exit;
?>
To use this code make sure the database name is changed to your own database name.
Submit your E-mail for further update or go to dkingsnet.blogspot.com to see other information which you are not seeing here. like our facebook page to chat with the admin.