How do I take while from this example and display only 1 die?

0

How do I take while from this example and display only 1 data?

    $query = $mysql->query("SELECT * FROM dados WHERE id='$id'");
    while($row = $query->fetch_array()){

    echo $row['nome'];
    }
    
asked by anonymous 18.04.2018 / 20:06

1 answer

1
$query = $mysql->query("SELECT * FROM dados WHERE id='$id'");
    $row = $query->fetch_array();       

    echo $row['nome'];
    
18.04.2018 / 20:22