How to get a json object within a mysqli_fetch_assoc while in php
<p>I'm trying to generate a json object within a mysqli_fetch_assoc query in a while like:</p>

<pre><code>        while ( $paises = mysqli_fetch_assoc ( $get ) ) :
            $country = array( 
                $paises['pais'] =&gt; properties::get_city($paises['pais'] ) 
            );
            echo json_encode( $country, JSON_UNESCAPED_UNICODE );
        endwhile;
</code></pre>

<p>The result of this is:</p>

<pre><code>{"MX":"México"}{"AR":"Argentina"}{"ES":"España"}{"UY":"Uruguay"}{"PY":"Paraguay"}{"CL":"Chile"}{"EC":"Ecuador"}{"BO":"Bolivia"}{"DE":"Alemania"}{"US":"Estados Unidos"} 
</code></pre>

<p>But this is wrong, becasuse the result that I expect is:</p>

<pre><code>{"MX":"México","AR":"Argentina","ES":"España","UY":"Uruguay","PY":"Paraguay","CL":"Chile","EC":"Ecuador","BO":"Bolivia","DE":"Alemania","US":"Estados Unidos"} 
</code></pre>

<p>What's wrong with my code? Thank you.</p>