PHP循环通过MySQL数组[重复]

This question already has an answer here:

I have the following PHP query code:

$theirTable = $dbcon->query("SELECT * FROM dogbreed");
$theirRow = $theirTable->fetch_assoc();

I am trying to understand the correct method for displaying all records in my chosen table in a loop. My request is done like so:

            <?php
                while ($fow = $theirRow){
                    echo $fow['dogtype'];
                }
            ?> 

This code proves problematic, as it repeats the first response endlessly. So I end up getting a result like dobermandobermandobermandobermandobermancontinously. Not sure what my problem is from a logic standpoint.

</div>

You should iterate over fetch_assoc result

      <?php
            while ($fow = $theirTable->fetch_assoc()){
                echo $fow['dogtype'];
            }
        ?>