I am trying to run a mysql query in my php page.This query is not working.I suspect that i have misunderstood the concept of PDO and bind parametr.Kind help me to understand the concept using my query an example
$UIN = $_SESSION['login1'];
$sql ="SELECT tbluser.Dep,tbldep.Dep1 FROM tbluser JOIN tbldep on tbldep.id=tbluser.Dep WHERE tbluser.UIN=:UIN";
$query= $dbh -> prepare($sql);
$query-> bindParam(':UIN', $UIN, PDO::PARAM_INT);
$query-> execute();
$results=$query->fetchAll(PDO::FETCH_OBJ);
$Depart_Name=$results->Dep1;
$Depart_id=$results->Dep;
echo $Depart_Name;
echo $Depart_ID;