SQL query on client side

SQL query on client side

menamena Posts: 2Questions: 0Answers: 0
edited June 2012 in General
Hello.
I work with server side processing, I have different data filters so I think to form SQL query on client side, and send it to server_processing.php
How can I do it? fnServerParams? And how I can send the whole query?
Second question I want to export data to excel (it is one of causes that I need my SQL query on the client side)
There is no tools for export to Excel for server side if I understand correctly.
Thanks!
Sorry for my English.

Replies

  • snarf2larfsnarf2larf Posts: 64Questions: 0Answers: 0
    You would never want to actually build the SQL query on the client-side and then pass it to the server. This would open you up to a massive security hole. What you should do is pass your filtering data using fnServerParams and then on the server side catch those, validate them and build the SQL query on the server side.

    For Excel output using tabletools I believe it will output what rows are returned by the server. So, if you need a lot of rows in the excel output you should return them all from your server side processing. If you are talking about thousands of records though you should look at a more efficient way to output the data you need.
  • menamena Posts: 2Questions: 0Answers: 0
    Ок. Thanks. I didnt think about security.
    I have more then 10 000 rows.
    Server side return just part of rows to client side on 1 page, not all as i understand. How I can export to excel all rows at once?
  • snarf2larfsnarf2larf Posts: 64Questions: 0Answers: 0
    If you want the user to be able to export 10,000~ rows I would suggest you build the excel server side and send it to the user. If, however, the user only needs 10-1000 rows or so you can alter your table and server response and then you can do the excel file client-side for those rows.
This discussion has been closed.