Hello,
I have a problem with the jquery $.get function. I'm trying to get data from PHP file needed to check does the specific user has subscription and is he recorded at ignore list by other users.
With this jquery code I can get only one of this two data from MySql using PHP file.
The jquery code is:
$(document).ready(function(){
$.get("getdata.php", function(returned_data) {
if(returned_data === "1") {
$("div#wall").html('user has no subscription');
$("#message_wall").attr("disabled", "disabled");
return false;
}
});
});
The PHP file has MySQL query and that page looks like this:
$query = mysql_query("SELECT * FROM subscription WHERE id=$ipr");
$result = mysql_fetch_assoc($query);
if (time() > $result['date']) {
echo "1";
} else {
echo "5";
}
$res = mysql_query("SELECT * FROM ignor WHERE migid=$ipr AND igid=$id") or die(mysql_error());
$num_rows = mysql_num_rows($res);
if ($num_rows >= "1") {
echo "2";
}
The thing that I need from jquery $.get function is separeted .attr() and .html() for each PHP echo response code (for echo "1", echo "2" and echo "5")
How can I do that with Jquery $.get?