$jsonData = file_get_contents('your_input.json');
$data = json_decode($jsonData, true);
$sqlFile = fopen('output.sql', 'w');
foreach ($data as $item) {
$tableName = 'tablo adi giriniz';
$columns = implode(', ', array_keys($item));
$values = implode(', ', array_map(function ($value) {
return "'" . addslashes($value) . "'";
}, $item));
$sql = "INSERT INTO $tableName ($columns) VALUES ($values);";
fwrite($sqlFile, $sql . PHP_EOL);
}
fclose($sqlFile);
header('Content-Type: application/sql');
header('Content-Disposition: attachment; filename="output.sql"');
readfile('output.sql');
Bu kodu kullanabilirsiniz.