Insert Data into MySQL Database using PHP, MySQLi, AJAX and JQuery PHP Script


Insert Data into MySQL Database using PHP, MySQLi, AJAX and JQuery PHP Script

This tutorial will show you how to insert data into mysql database using PHP, MySQLi, AJAX and JQuery. You might wonder why use AJAX and JQuery when you can insert into database using PHP and MySQLi. Yes, but with the use of AJAX and JQuery, you don’t need to reload the page in doing an action. This tutorial will not give you a good design but will give you idea on the topic.

 

  1. CREATE TABLE `post` (
  2. `postid` INT(11) NOT NULL AUTO_INCREMENT,
  3. `post_text` VARCHAR(200) NOT NULL,
  4. `date_time` datetime NOT NULL,
  5. PRIMARY KEY(`postid`)
  6. ) ENGINE=InnoDB DEFAULT CHARSET=latin1;

 

 

Creating our Connection

Next step is to create a database connection and save it as “conn.php”. This file will serve as our bridge between our form and our database. To create the file, open your HTML code editor and paste the code below after the tag.

 

  1. <?php
  2. //MySQLi Procedural
  3. $conn = mysqli_connect(“localhost”,“root”,“”,“ajax_insert”);
  4. if (!$conn) {
  5. die(“Connection failed: “ . mysqli_connect_error());
  6. }
  7. ?>

 

 


Related Post


Mobile Site Builder Pro PHP Script Download Mobile Site Builder ProMobile Site Builder Pro Create unlimited hosted mobile sites with tons of features. From social media to e-commerce, from im...
Responsive Documentation Generator v1.0.2 PHP Scri... Responsive Documentation Generator v1.0.2Responsive Documentation Generator v1.0.2 The RDGDocumenter offers a way to generate documentations, Some ...
Ekattor v6.0 – School Management System R... Ekattor v6.0 - School Management System - nulled PHP Script Download   Ekattor School Management System is the most complete and versatile sc...
Object Oriented C Programming In PHP With advance ... Object Oriented C Programming In PHP With advance query and trapping sql injection PHP Script 1. Create Database name OOP 2. Create table about yo...
Azon-mobi v2 Autoindex PHP Script Free Download Azon-mobi v2 Autoindex PHP Script Free Download Free download page for Project AutoIndex PHP Script (Directory Indexer)'s AutoIndex-2.2.4.zip.AutoI...

Read Me

Have any Question or Comment?

Leave a Reply

Your email address will not be published. Required fields are marked *