Skip to main content

Posts

Showing posts from September, 2022

How to Insert Multiple Checkbox Value in Database using PHP MySQL

  In this tutorial, you will learn about how to insert multiple checkbox values into the database in php MySQL and it is a simple method to use the checkbox in HTML form. what is the use of a checkbox? The checkbox is used to select multiple options needed to be checked, for example, In the HTML form or HTML, we create a  course form and the joining student needs to select the list of options and the students or users to select the choices to learn and insert to the database. $ads={1} And the institute analysis the student needs and allocates the classes and timetable for the student to attend the course. Checkbox is the more useful in this case and checkbox are easy way to check or uncheck setting and checkbox are select one or more number of choices. checkbox are easy to understand and <input type="checkbox"> tag is use to view on html page. Here, I am using the bootstrap framework to view for design and user interface. I already create a database and named as ...

How to insert data in the Mysql database using php ajax

In this tutorial, we are going to learn how to insert data in the MySQL database using PHP Ajax. OK, Mainly Ajax is used for sending and receiving data from the server without reloading the page and the same page easily insert multiple data. $ads={1} First, we need to create three empty files  dbconfig.php index.php savedata.php   And then, I already created a database and I named it studentresults and create a table student. CREATE A TABLE: CREATE TABLE student ( id int(11) NOT NULL AUTO_INCREMENT PRIMARY KEY, name varchar(100) NOT NULL, email varchar(50) NOT NULL, mobileno varchar(100) NOT NULL, city varchar(50) NOT NULL ); DBCONFIG.PHP <?php $servername = "localhost"; $username = "root"; $password = ""; $dbname="studentresults"; $conn = mysqli_connect($servername, $username, $password, $dbname); ?> INDEX.PHP <html> <head> <title>Insert data in MySQL database using Ajax</title> <lin...

HTML code to prepare student result sheet in website using jquery

  In this tutorial, we are going to learn how to create an HTML code to prepare a student result sheet on the website and get the results using Jquery. ok, Let's see, we have to build a simple website  with  HTML code for marksheets like pass or fail and  where you can upload the student data like their student name, Marks in different subjects, and finalize the total Marks and results.  If the student is Pass or Fail status. And the implementation of using HTML code and Jquery. ok, Whatever you entered in the HTML code in the editor it will be displayed like plain text and the type of tag you are using in the HTML. HTML code student result sheet:- <div class="container py-5"> <h1 class="text-center">Student Marksheet Insert</h1><br/> <div id="success" class="alert alert-success close" style="display:none;"> </div> <fieldset> <div class="row py-5"> <div class...

Insert data into mysql database using php

In this tutorial, we are going to learn how to insert the data into the MySQL database using php and there are two methods used to insert the data called MySQLi and pdo with examples. $ads={1}   Now, we are using the INSERT INTO   statement on the database table to insert the rows. ok, Let's see, how they execute the SQL query using the INSERT INTO statement with values, after that passing the data using MySQLi in PHP function. Ok, I already created the database and the table name student_details. Read also: How to use php pdo fetch class php connect to mysql database Activate and deactivate in php and mysql How to filter table in active status in php   Database Table: create table student_details ( student_id int PRIMARY KEY AUTO_INCREMENT, student_name varchar(255) not null, class varchar(50) not null, mobile_no varchar(25) not null ); INSERT DATA USING PDO: <?php $hostname = "localhost"; $username = "root"; $password = ""...

How I fetch country name from another table using query in PHP

In this tutorial, you will learn how to fetch data from a database particular table rows like county names from another table using a query in PHP. Here, in the below code we are exploring the JQuery Ajax example with PHP MySQL for sending an Ajax get request and fetching data from MySQL database server using PHP and PDO.  And know I created three empty files and named as:   dbcon.php fetch.html get.php And so, create a SQL database ,I already have database name "phptut" and table name "customer". Database Table: CREATE TABLE customer ( cust_id int AUTO_INCREMENT PRIMARY KEY, cust_name varchar(50) NOT null , address varchar(255) NOT null, country varchar(50) NOT null, city varchar(50) NOT null ); Insert values into table: INSERT INTO `customer`(`cust_name`, `address`, `country`, `city`) VALUES (‘chandra’,’paris street’,’india’,’chennai’); INSERT INTO `customer`(`cust_name`, `address`, `country`, `city`) VALUES (‘anbu’,’canada street’,’india’,’chennai’);...

Write a PHP script to retrieve and display all records of table student details with following attributes

In this tutorial, how to create a PHP script to retrieve or fetch and display all records of table student details using MySQL database is simple to do with the following attributes. And using MySQL select query in PHP to fetch data and display it in the front end. In the database table create 3 columns and name with student_name, class, mobile no create table student_details ( student_id int AUTO_INCREMENT PRIMARY KEY, student_name varchar(50) not null, class varchar(30) not null, mobileno varchar(50) not null ); Insert values into Database: INSERT INTO student_details(student_name,class,mobileno) VALUES ('chandra',9,9874563211); INSERT INTO student_details(student_name,class,mobileno) VALUES ('anbu',8,9874563213); INSERT INTO student_details(student_name,class,mobileno) VALUES ('priya',9,9874563214); INSERT INTO student_details(student_name,class,mobileno) VALUES ('vidya',9,9874563215); INSERT INTO student_details(student_name,class,mobi...

How to implement prototype inheritance with constructor functions

In this tutorial, you will learn how to implement prototype inheritance with constructor functions. The JavaScript classes don't work like traditional classes in other languages like Java. So instead, classes in JavaScript are just syntactic over. So they still implement prototype inheritance behind the program but with a syntax that makes more sense to people coming from other programming languages. And so that was basically the goal of adding classes to JavaScript. So we can write the class and then the name of the class. And let's actually call it User then curly braces is to add a constructor method .   constructor(firstName, lastName , age) So just like this, this constructor actually works in a pretty similar way as a constructor function, like the previous article JavaScript constructor function but this one is actually a method of this class. And in fact, it needs to be called a constructor. So that is the rule. But just like in constructor functions, we pass in...

How to javascript prototype this keyword works

 In this tutorial you will learn about how to JavaScript prototype this keyword works in the prototype in the JavaScript.  const User = function User () { this.firstName = 'chandra'; this.lastName = 'kumar' ; } const User1 = new User(); User1.age = 28; console.log(User1.age); const User2 = new User(); console.log(User2.age); 28 undefined In the above code example, age properties are attached to the User1 instance. and the User2 instance will not have age property and the console result of undefined, because the age is defined only in User1. In this case, the prototype is associated with all functions and objects by the default JavaScript, where the prototype property is easy to access and modify the objects. For example, the prototype is the special type of enumerable object to easily add the properties and share across all the instances of its construction function. const User = function User () { this.firstName = 'chandra'; this.lastName =...