<?php
require_once ("varables.php");

$myJSON['message'] = "000";
$myJSON['album'] = array();
if(isset($_POST["nekot"]) && isset($_POST["an1d"]) && isset($_POST["pId"]))
{	
	$pId = $_POST["pId"];
    $connect = @mysqli_connect($hostname,$username,$password,$database);
    if($connect)
    {
        @mysqli_query($connect,"SET CHARACTER SET utf8mb4;");
        $query = "SELECT id,img FROM tbl_pAlbums WHERE pId = '".$pId."'";
		$res=@mysqli_query($connect,$query);
        if (!$res) {
            $myJSON['message']= @mysqli_error($connect) ;
        }
		else{
            while($rowt = @mysqli_fetch_assoc($res)){
				array_push($myJSON['album'], $rowt);
			}
            $myJSON['message']= "200" ;
		}
	}
	 else
		 $myJSON['message']="402";
}
    echo json_encode($myJSON);

?>
