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

Free Live Chat for Any Issue


	$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.