Well I'm started in the database study and I came across the following situation I 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 question is how do I now import this data into a MySQL database? (I've already created a database, and a table)