<?php
    $tabla="productos";
    $id = intval($_GET['id']);
    include '../rdb/conn.php';

    $sql= " select count(*) from $tabla where id = $id";
    
    $rs = mysqli_query( $conn,$sql);
    $row = mysqli_fetch_row($rs);
    $result["total"] = $row[0];
    
    $sql="select * from $tabla where id=$id order by id";

    $rs = mysqli_query( $conn,$sql);
    $items = array();
    $row = mysqli_fetch_array($rs);
    echo($sql);
    echo json_encode($row);
    
?>