how to display data in datatable , by retrieving it from the database?

how to display data in datatable , by retrieving it from the database?

vaishnavkokavaishnavkoka Posts: 132Questions: 23Answers: 1

https://datatables.net/examples/server_side/defer_loading.html

1.javascript part

line no: 5

"ajax": "scripts/server_processing.php",
ajax represents the location of the php file right ?

line no:6
"deferLoading": 57
how do i make this dynamic as there can be any number of records in the database

html part
initially you have added some records in the datatable and these would increase with every click of pagination button.

but i completely want to display data which is retrieved from the database( every single record) and hence would like to make it dynamic retrieval.

css part
its clear to me

server-side script part
line no :36
why you have separately written the format for start_date?
well in my case i have to dates a) start date b)end date
how should i write a array for dates part?

line no:53
though i have written the correct details in my program i still didnt get the results on my webpage

line no:66
how do i write a code for ssp.class.php ?
can you should be your code ?

line no:68
how do i make use of json_encode?
is there any separate code written for json for your datatable ?

line no:69
i have used the post method in my php program and changed to get method still it didnt work

can you please help to solve my issue ? and how do i write a ajax code for my issue as you have mentioned in your answer

Thanks
Koka

Answers

  • colincolin Posts: 15,142Questions: 1Answers: 2,586
    edited June 2018

    Hi Koka,

    This looks like a repost from this thread. There's a lot of questions here, so the best bet would be to look in the reference section of this site as there's lot of help and suggestions there.

    If still no joy, we're happy to take a look, but it would help, as per the forum rules, if you could link to a running test case showing the issue so we can offer some help. Information on how to create a test case (if you aren't able to link to the page you are working on) is available here.

    Cheers,

    Colin

This discussion has been closed.