I have a query that is this
SELECT COUNT(id_orden) as cuantas FROM 'orden_trabajo' ORDER BY status
this gives me a result of
cuantas
46
my problem is that I can not pass this result of the query to an html. my idea was to pass it to a function like this
function total(){
include("dbconnect.php");
$total=0;
$sql = $conn->prepare("SELECT orden_trabajo.status, COUNT(id_orden) AS
cuantas FROM orden_trabajo ORDER BY status ");
$sql->execute();
if ($sql->rowCount () > 0){
while($total=$sql->fetch(PDO::FETCH_ASSOC))
{
return $total['no_reporte'];
}
}else{
return "NA";
}
}