2026 Executive BenchmarkMid-Market Enterprise Modernization: How leaders across unify Commerce, Odoo ERP & AI in 90 days.
PHP DEVELOPMENT

Insert data in Database Using Jquery

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

Akshar Group Technologies
Dec 25, 2020
1 min read
Verified Source

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

php
<?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');
}
});
});
});
?>

Name :

Password :

Create Filename :- code.php
code
{ echo "1"; }
else
{ echo "2"; }
?>
Share this playbook
LET'S BUILD WHAT'S NEXT

What's Holding Your Business Back?

Tell us where you want to go, what's getting in the way, and we'll help you figure out the technology to get there.

No sales pitch. Confidential strategic advisory.