problem with server side data table
problem with server side data table
ahm_ijal
Posts: 4Questions: 1Answers: 0
i have this problem : 7. Warning: Ajax error
the problem is because am fetching data from two tables from database, and i cant configure datatables in the right way to achieve this.
the table is as following :
Name(col from table A) ; phone(col from table A) ; Total( sum of due col from table b) ; Paid( sum of due col from table b) ; Due( sum of due col from table b)
the error is database error:
unknown column name 'total' in table A
datatable debugger code : emeqek
This discussion has been closed.
Answers
Thanks for your question - however, per the forum rules can you link to a test case showing the issue please. This will allow the issue to be debugged.
Information on how to create a test page, if you can't provide a link to your own page can be found here.
Thanks,
Allan
@allan :
thanks for explaining some stuff for me, anyway this is the datatable debugger code : emeqek ,
thanks again
It looks like a problem with your server-side script. It is returning information about an SQL error. I'm not sure what your SQL script is or what it is doing, but that is where you need to look.
Allan
i know that its from the server side script, and the error because i have a computed cols in the datatable which i didnt know how to write the proper code for the datatable, and i think that i cant do such thing with datatable (i hope am wrong).
i use codeigniter, and my server scipt is missed up and i need to know how to write it well to solve the problem
ill demonstrate the issue in psuedo code:
1- select * from customers
2- for each customer->id :
select sum(total), sum(due), sum(paid) from invoice(another table in db)
problem happens when trying to sort or search:
the datatable cant sort cauze sum(whatever) is not a valid column at the customer table
thanks
You ave server-side processing enabled, so you would need to have your script conform to the client / server communication required by DataTables.
Or, if you aren't handling tens of thousands of rows, just disable server-side processing.
Allan
it looks like datatables is not the solution for my situation, thanks for helping me, and sorry for disturbing