1 votes

How can I show the quantity of orders through a query in mysql "select distinct" in PHP

I am currently trying to show the amount of requests of a query in mysql in PHP, however I cannot bring that result to PHP my code is this:

 $sql = mysqli_query($con, "SELECT count(distinct Pedido) FROM pedidos");


$qty= 0;


while ($row = mysqli_fetch_assoc($sql)) {   
    $qty=$row['Pedido'];
}

echo $qty;
    

Someone who can help me please

HolaDevs.com

HolaDevs is an online community of programmers and software lovers.
You can check other people responses or create a new question if you don't find a solution

Powered by:

X