view list of returned items in json format with php and mysql

Asked

Viewed 176 times

0

I am developing a website for a real estate, at the moment I am listing the properties and paging the result with sql queries, are listed more than 2000 properties and there is a significant delay in uploading the content. I am thinking of returning the result of the sql query in JSON format with an AJAX request and listing the contents with Jquery.

What are the advantages and disadvantages of using this standard? Will I have performance in the content shipment? It is advisable to use AJAX requests that return large amount of content in JSON format?

  • 1

    It is not better to page the query?

  • There is already paging, but the content is displayed with direct query in sql, I want to return the result in json format.

  • Can you put the code that returns this query? vc does some processing or formatting in return?

  • 1

    I’ll edit the question.

  • You will have a little more processing because you will need to take the array of values returned from the database and apply a json_encode, however, I believe that it is nothing very significant not. However, the delay will depend on your return algorithm.

  • Is it better if I already return the html in ajax to insert the html dynamically? In this case I make a query Gero the html with echo, and in ajax I inform dataType: html. This way I get a better performance than returning json?

Show 1 more comment
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.