jquery - Response not received from ajax request in php -
i have page there table , each row has icon detailed information. when icon clicked, unique identifier row datastring , send ajax request. response cannot catch correct response. why doing wrong? need access $desc in home.php , how catch in response ?
home.php
$.ajax({ type: "post", url: "actionone.php", data: datastring, cache: true, success:function() { alert("success"); } });
actionone.php
if(isset($_post['content'])) { $content=(int)$_post['content']; $fetch = mysql_query("select issuedescription issues kbid =$content"); while($rowe = mysql_fetch_array($fetch)) { $desc = $rowe['issuedescription']; }
for ajax success work output php code ie change php code to
if(isset($_post['content'])) { $content=(int)$_post['content']; $fetch = mysql_query("select issuedescription issues kbid =$content"); while($rowe = mysql_fetch_array($fetch)) { $desc = $rowe['issuedescription']; } echo $desc; }
jquery
$.ajax({ type: "post", url: "actionone.php", data: datastring, cache: true, success:function(data) { alert(data.trim()); } });
Comments
Post a Comment