1
Well I am started in the database study and I came across the following situation have this json file with the following data:
[{"nome":"José","ddd":27,"telefone":21239990,"cpf":"11111111111","sabe_programar":true},{"nome":"João","ddd":27,"telefone":21239990,"cpf":"22222222222","sabe_programar":false},{"nome":"Maria","ddd":27,"telefone":21239990,"cpf":"22222222222","sabe_programar":true},{"nome":"Antônio","ddd":27,"telefone":21239990,"cpf":"22222222222","sabe_programar":false}]
Well I already managed to pass it to php, with this code:
<?php
$arquivo = file_get_contents('pessoas.json');
$json = json_decode($arquivo);
foreach($json as $registro):
echo 'nome: ' . $registro->nome . ' - ddd: ' . $registro->ddd . ' - telefone: ' . $registro->telefone . ' - cpf '. $registro->cpf . ' - sabe_programar' . $registro->sabe_programar . '<br>';
endforeach;
My doubt is how do I now import this data into a Mysql database? (I have already created a database, and a table)
Like this keeping the proportions of each language? https://answall.com/a/236529/64969
– Jefferson Quesado