This is the header information sent. This is the response data. This is the data printed on the background page and finally pasted with the background code: {code ...}
This is the sent header information.
This is the response data
This is the data printed on the background page.
Finally, paste the background code:
If ($ _ POST ['idp']) {// if idp exists in the address bar, obtain the product information through idp; otherwise, obtain the product information based on the current time (obtain the latest data) $ idp = $ _ POST ['idp']; $ SQL = "SELECT * FROM 'product' WHERE id = {$ idp}" ;}else {// if no idp exists, obtain the latest product information $ SQL = "SELECT * FROM 'product' ORDER BY time DESC LIMIT 1";} // defines the constant $ result = array (); $ commentData = array (); // Read product details $ productRes = mysql_query ($ SQL, $ connect); $ productData = mysql_fetch_array ($ productRes, MYSQL_ASSOC ); // product details and corresponding comments Result set array_push ($ result, $ productData, $ commentData); // array_shift ($ result); echo json_encode ($ result);?>
Reply content:
This is the sent header information.
This is the response data
This is the data printed on the background page.
Finally, paste the background code:
If ($ _ POST ['idp']) {// if idp exists in the address bar, obtain the product information through idp; otherwise, obtain the product information based on the current time (obtain the latest data) $ idp = $ _ POST ['idp']; $ SQL = "SELECT * FROM 'product' WHERE id = {$ idp}" ;}else {// if no idp exists, obtain the latest product information $ SQL = "SELECT * FROM 'product' ORDER BY time DESC LIMIT 1";} // defines the constant $ result = array (); $ commentData = array (); // Read product details $ productRes = mysql_query ($ SQL, $ connect); $ productData = mysql_fetch_array ($ productRes, MYSQL_ASSOC ); // product details and corresponding comments Result set array_push ($ result, $ productData, $ commentData); // array_shift ($ result); echo json_encode ($ result);?>
The json returned by accessing roamguid.sinaapp.com/page/detail/getdetail.php isGET, The execution is$sql = "SELECT * FROM Product ORDER BY time DESC LIMIT 1";
And youpostUploadedidpIsfalse?