Ask a question about mysql traversing to json. I use PHP to pass a value to JqueryAJAX. $. parseJSON parsing I have learned how to query a record. if you want to upload multiple records. there is a problem. // A record // $ row = mysql_fetch_array ($ result); // echojson_encode ($ ask a question about mysql traversal to json.
I used PHP to pass a value to Jquery AJAX. I used $. parseJSON for parsing.
I have learned how to query a record. if I want to upload multiple records, it will be a problem.
// One record
// $ Row = mysql_fetch_array ($ result );
// Echojson_encode ($ row );
// Multiple records
While ($ row = mysql_fetch_array ($ result )){
Echo json_encode ($ row );
};
In this way, if there are two pieces of data, return such a json
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.