jquery-database

-Insert data in Database Using Jquery -Create a index.php and code.php file with code -database name ‘school’ -tabale Name ‘class’ -thene Working it code File Name :- index.php

  //Install Jquery

$('document').ready(function(){
$('#button').click(function(){
if($('#fname').val()==""){
alert("Enter first name");
return false;
} else
{
var fname = $('#fname').val();
}
if($('#passwd').val()==""){
alert("Enter Password");
return false;
}else
{
var password = $('#passwd').val();
}
jQuery.post("code.php", {
firstname:fname,
pass: password
},  function(data, textStatus){
if(data == 1){
$('#response').html("Registration successfull!!");
$('#response').css('color','green');
}else{
$('#response').html("Some Error Occurred");
$('#response').css('color','red');
}
});
});
});

Create Filename :- code.php

0){
echo "1";
}else{
echo "2";
}
?>

About Author:

Kalpesh Chavada

Kalpesh Chavada is Our Founder & CEO of Akshar Group Technologies. He is serving with 11+ years of experience in different technologies like Magento, WordPress, Laravel, jQuery, Shopify, Branding, and Digital Marketing. He is very good with creative logic and always ready to take on challenges.

Kalpesh Author