如何在PHP中循环列条目?

I'm trying to iterate through all the rows in a MYSQL table given the column name. I'm looking through the PHP docs and StackOverflow questions, but for some reason the while loop method didn't exactly work. Here's what I have so far:

include 'dbcon.php';

$dbcon = getConnection();
$currentUser= $_COOKIE['currentUser'];
$getIpQuery = mysqli_query($dbcon, "SELECT $currentUser FROM ipList");

$row = mysqli_fetch_array($getIpQuery, MYSQLI_NUM);
printf(count($row));
for($x=0;$x<count($row);$x++)
{
    printf("%s", $row[$x]);
}

This code returns only the first entry in the table which looks like this

--------------------
placeholder    user //(same as $currentUser)
NULL           value1
NULL           value2

the function mysqli_fetch_array returns only 1 row per call. you need to iterate while the function returns values:

$result = mysqli_query($__CONNECTION__, $getIpQuery) 
while($row = mysqli_fetch_array($result)){
    for($x=0;$x<count($row);$x++)
    {
        printf("%s", $row[$x]);
    } 
}