how to insert multiple json data into mysql database in php code example
Example: how to insert multiple json data into mysql database in php
<?php
$josndata = '{
"Customer":{ "name":"Jonny", "country":"CANADA", "ContactNo":524587777 },
"Student":{ "name":"Gussy", "country":"USA", "ContactNo":9856452100}
}';
$conn = new mysqli('localhost', 'username', 'password', 'databasename');
$sql = "INSERT INTO student_table ( name, jsondata )
VALUES ('Multidata', '$josndata')";
if ($conn->query($sql) === TRUE) {
echo "Insert your Multiple JSON record successfully";
}
?>