1<?php
2
3$josndata = '{
4"student":{ "name":"Harry", "country":"United State", "ContactNo":2545454 }
5}';
6
7// Database connection
8$conn = new mysqli('localhost', 'username', 'password', 'databasename');
9
10// Insert data Query
11$sql = "INSERT INTO student_table ( name, jsondata )
12VALUES ('Harry', '$josndata')";
13
14if ($conn->query($sql) === TRUE) {
15 echo "Insert your JSON record successfully";
16}
17?>