$server="localhost";
$username="root";
$password="";
$con=mysqli_connect($server,$username,$password);
if(!$con){
die("connection to this database failed due to" . mysqli_connect_error());
}
else{
echo "Database successfully connected"
}
$sql="INSERT INTO `student_details`.`users` (`name`, `gender`, `email`, `tel`, `desc`)
VALUES ('$name', '$gender', '$email', '$phone', '$desc');";
//echo $sql;
if($con->query($sql)==true){
//echo"successfully inserted";
$insert=true;
}
else{
echo "ERROR: $sql <br> $con->error";
}
$con->close();
- Data Validation
- Data Insertion into Database
- Data retreival