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.
Bu jquery kodu ile ben PHP dosyası kullanarak MySql bu iki verinin yalnızca birini alabilirsiniz.
JQuery kodu:
$(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;
}
});
});
PHP dosyası MySQL sorgusu vardır ve bu sayfa, bu gibi görünüyor:
$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";
}
Her PHP echo yanıt kodu için ben jquery $ ihtiyacım şey. Olsun fonksiyonu. Separeted attr () ve. Html () ("1" echo için, "2" echo ve "5" echo)
Jquery $ ile bunu nasıl yapabilirim. Olsun?