How does the mysqli_fetch_assoc function work? Example, if I use it in a function as below in PHP. What does it do?
function buscar_tarefas($conexao){
$sqlBusca = "SELECT * FROM tarefas";
$resultado = mysqli_query($conexao, $sqlBusca);
$tarefas = array();
while($tarefa = mysqli_fetch_assoc($resultado)){
$tarefas[] = $tarefa;
}
return $tarefas;
}