hi i want to retrieve whole column from DB but store it in associative array. i write the code but its returning me only the last record. i want to return me the whole column. anyone can help?
public function GetMarks(){
$query=mysql_query("SELECT name, marks FROM marks,users WHERE marks.id=users.id ");
while($rows=mysql_fetch_assoc($query)){
$name=$rows["name"];
$mark=$rows["marks"];
$fullmark=array("Name"=>$name,"Marks"=>$mark);
$mk=json_encode($fullmark);
}
echo $mk;
}