PHP and HTML Code To Insert Data To Database
PHP and HTML Code To Insert Data To Database
SOURCE CODE:
W1.html
<html>
<head>
</head>
<body>
student.php
<?php
ini_set('display_errors', 1);
error_reporting(-1);
$con = mysqli_connect("localhost","kashi","dbpassword","studentphp");
$rno = $_POST['t1'];
$fname=$_POST['t2'];
$lname=$_POST['t3'];
$sql = "insert into students values ('$rno','$fname','$lname')";
$rs=mysqli_query($con,$sql);
if($rs)
{
echo " Records Inserted";
}
else
{
echo "Porblem";
}
?>
OUTPUT:
DATABASE: