Populating a dropdown list from database variable php

I am trying to populate a dropdown list with variables from a database, but the dropdown is appearing blank. I think the issue is with how I am echoing out the data.

<div class="col sm-4">
    <label for="paperSelects1"><b>Select Breed to Update</b></label>

    <select id='updatebreed' name='ubreed'>

            <?php while($row = $result->fetch_assoc() ){
                $breed_data = $row['breed'];
                $dogid = $row['dogid'];
            
                echo "<option value='$dogid'> $row </option>";
            }
            ?>
            
    </select> 
        <input type="submit" value="Submit">
</div>

Here is my connection to the db. Where am I going wrong?

<?php

    include("../config/connect.php");

    $read = "SELECT * FROM dog_best_in_show ";
   
    $result = $conn->query($read);

?>

Answer

You used wrong php variable which not assigned so please update so please update it

 echo "<option value='$dogid'> $row </option>";

To

 echo "<option value='$dogid'> $breed_data</option>";

So your full code will be like this, I am using pdo connection so this is pdo code

<?php
$servername = "localhost";
$username = "root";
$password = "";
$dbname = "test";
?>


<div class="col sm-4">
<label for="paperSelects1"><b>Select Breed to Update</b></label>

<select id='updatebreed' name='ubreed'>
    <?php
    $conn = new PDO("mysql:host=$servername;dbname=$dbname", $username, $password);
    $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
    $stmt = $conn->prepare("SELECT * FROM dog_best_in_show");
    $stmt->execute();
    // set the resulting array to associative
    $result = $stmt->fetchAll();
    foreach ($result as $k => $v) {

        $breed_data = $v['breed'];
        $dogid = $v['dogid'];

        echo "<option value='$dogid'> $dogid </option>";
    }
    ?>

</select>
<input type="submit" value="Submit">
</div>