How to store a row into an array in PHP and echo out a certain value of the array?
<p>I'm trying to query data from a row in a table, store the data into an array, and then echo out a certain value from the array.  Here's the PHP:</p>

<pre><code>$receiveuserdata = mysqli_query($connection, "SELECT * FROM s_users LIMIT 0,1");

$userdata = array();
$index = 0;
while ($row = mysqli_fetch_assoc($receiveuserdata)) {
    $userdata[$index] = $row;
    $index++;
};
</code></pre>

<p>I've tried using other posts related to this issue for help, but most are outdated.  Here's my attempt to echo a value from the array:</p>

<pre><code> &lt;h3&gt;Username: &lt;?php echo $userdata[0]; ?&gt;&lt;/h3&gt;
</code></pre>

<p>Am I using <code>$receiveuserdata</code> incorrectly?</p>