ok I surrender .... I have 2 function very very easy but don't understand where is my error in php function ... This is my php function
function chkstatus(){
global $mysqli;
//$cc=array();
$sql="SELECT * FROM online WHERE id=".$_GET['idonline'];
$result=$mysqli->query($sql);
$row=$result->fetch_array();
header('Content-type: application/json');
/*$cc[]=array('value'=>$row['busy']);
$ccstr=json_encode($cc);
echo $ccstr;*/
echo $row['busy'];
}
And my javascript function
function chkstatus(){
var iduser=$('#idop').val();
$.ajax({
url: 'chat.php?action=chkstatus',
data:{idonline:iduser},
dataType: 'json',
cache: false,
success: function(data){
console.log(data);
},
error: alert("error")
});
setTimeout('chkstatus();',4000);
}
I have ever the error alert, and in console I haven't nothing! Any idea where I have this error???