<?php require_once("../../includes/initialize.php"); ?>
<?php include '../comunes_php/session_control.php'; ?>
<?php
    	$id= $_REQUEST['id'];

       include '../rdb/conn.php';

	$rs = mysqli_query( $conn,"select * from matrices where id in (select matriz_id from relacion_producto_matriz where producto_id=$id) order by nombre");
	
	$rows = array();
	while($row = mysqli_fetch_assoc($rs)){
	    $rows[] = $row;
}
	echo json_encode($rows);
?>