Example For Insert Record login
Register Here
Name:
Age:
Email:
DOB:
Salary
  
--------------------------------------------------- PHP Employee Name is $eName"; echo "
Employee Age is $eAge"; echo "
Employee Email is $eEmail"; echo "
Employee Date Of Birth is $eDob"; echo "
Employee Salary is $eSalary"; #--------------------------------------------------------- $host = 'localhost'; $user = 'root'; $pass = ''; $dbname = 'new'; $conn = mysqli_connect($host, $user, $pass,$dbname); if(! $conn ) { die('Could not connect: ' . mysqli_error()); } echo '
Connected successfully'; #----------------------Query------------------------------------ $sql="INSERT INTO `employee`(`Emp_name`, `Emp_age`, `Emp_email`, `Emp_dob`, `Emp_salary`) VALUES ('$eName',$eAge,'$eEmail', '$eDob', $eSalary)"; #------------------------------------------------------------------- # this is comment area #$sql = "INSERT INTO employee VALUES ('','$eName', $eAge, '$eEmail', $eDob, $eSalary)"; echo "
"; echo "$sql"; #-------------Query Execute---------------------------- if(mysqli_query($conn, $sql)){ echo "Record inserted successfully"; } else{ echo "Could not insert record: ". mysqli_error($conn); } #------------------------------------------------------------------ #Connection Close After operation mysqli_close($conn); ?>