how to get serialized array data in php?

Today, We want to share with you ajax serialize form data to php.In this post we will show you jquery serialize array for post, hear for how to get serialize form data in php we will give you demo and example for implement.In this post, we will learn about submit form using ajax javascript with an example.

How to Insert Data using serialize method PHP Ajax?

Table user_data

   CREATE TABLE `user_data` (
  `id` int(11) NOT NULL,
  `UserName` varchar(100) NOT NULL,
  `FullName` varchar(50) NOT NULL


	$servername = "localhost";
	$username = "Aits_ams";
	$password = "DSF8754#$%^fcdf";
	$conn = mysqli_connect($servername, $username, $password,$db);


<!DOCTYPE html>
<script src=""></script>
$(document).on('click','#update',function(e) {
    var data = $("#form-search").serialize();
         data: data,
         type: "post",
         url: "update.php",
         success: function(data){
	<form action="" id="form-search">
	  User name: <input type="text" name="UserName" value="Rahul"><br>
	  Last name: <input type="text" name="FullName" value="Virat"><br>
	<button id="update" name="update">Serialize form values</button>


	include 'database.php';
	$sql = "INSERT INTO `user_data`( `UserName`, `FullName`) 
	VALUES ('$UserName','$FullName')";
	if (mysqli_query($conn, $sql)) {
		echo "Good Luck, Succeess !";
	else {
	    echo "Sorry, Genrated Error !";

I hope you get an idea about serialize form data in js.
I would like to have feedback on my blog.
Your valuable feedback, question, or comments about this article are always welcome.
If you enjoyed and liked this post, don’t forget to share.

Read Also:  JQuery AJAX form Submit and serialize send Server Side

Related FAQ

Here are some more FAQ related to this Article:

  1. Read Also:  vue Image Upload Component
  2. Read Also:  check if folder exists before create directory Laravel
  3. Read Also:  Remove null values from array in PHP
  4. Read Also:  PHP Laravel Join Query Example
  5. Read Also:  Display Image Preview Before Upload Multiple Images using jQuery,Ajax And PHP
  6. Read Also:  get value of radio button jquery
  7. Read Also:  Eloquent Order By Relation Column in Laravel
  8. Read Also:  javascript split string by comma
  9. Read Also:  Laravel 7 Custom Pagination View Example Tutorial
  10. Read Also:  PHP Highlight search matching text Results with Mysql