hi can someone help? I'm retrieving from database and i want to display it on screen. i use aler in my ajax to see if it's working but it's not alerting anything. anyone can tell me what's wrong?
client:
function client{
...
....
public function GetMarks(){
$query=mysql_query("SELECT users.name, marks.MarksHighest FROM marks,users WHERE marks.name=users.name ORDER BY MarksHighest ASC");
$q=mysql_fetch_assoc($query);
$name=$q["users.name"];
$high=$q["marks.MarksHighest"];
$mk=array("Name"=>$name,"Marks"=>$high);
$mk1=json_encode($mk);
echo $mk1;
}
..
}
ajax call:
server.prototype.GetMarks=function(){
$.ajax(
{url:"getmark.php",
type:"POST",
dataType:"json",
success:function(data){
alert(data.Name);
}});
}
getmark.php
<?php
//import connection file and appropriate php file
$con=new server();
$client1=new client();
$con->connect();
$x=$client1->GetMarks();
?>