javascript - Retrieve contents from a php file using json data type and ajax -
I used Ajax Post with a php file and Datatype Jason to fetch content from the display. But I'm new to Jasonson and I'm unable to get content from php file. Only numeric value is fetched here is the code I am using
var jqxhr = $ .ajax ({type: 'POST', url: 'events_fetch.php', Data: {eventID: calEvent.id, action: 'LOAD_SINGLE_EVENT_BASED_ON_EVENT_ID'}, datatype: 'Jason'}) .Down (function (AD) {warning (AD);}); I used the above mentioned task to get content from php file and alerted me. But alertness is not working. Guide me to what I am doing wrong. Here is my PHP code
events_fetch.php $ eventID = mysql_real_escape_string ($ _REQUEST ["eventID"]); $ Qry = "select 'from' event 'where' id` = '$ eventID'"; $ Race = mysql_query ($ qry); $ = Bringing mysql_fetch_array ($ resolution); $ Strtdate = $ fetch ['start date']; $ Strttime = $ fetch ['start-time']; $ RetValue = array ($ strtdate, $ strttime); Echo $ retValue;
Edit your events_fetch.php below
$ EventID = mysql_real_escape_string ($ _ request ["eventID"]); $ Qry = "select 'from' event 'where' id` = '$ eventID'"; $ Race = mysql_query ($ qry); $ = Bringing mysql_fetch_array ($ resolution); $ Strtdate = $ fetch ['start date']; $ Strttime = $ fetch ['start-time']; $ RetValue = array ($ strtdate, $ strttime); Echo json_encode ($ retValue);
Comments
Post a Comment