Can't read data from MySQL View
Can't read data from MySQL View
Hi,
I am trying to use Server-side Processing based on the example https://datatables.net/examples/server_side/simple.html.
It works fine if I use it on a table in the MySQL database. Output can be seen at gutefar.se/simple.html (and gutefar.se/server_processing.php).
When I try to connect to a MySQL View instead of a MySQL table I run into problem. I get a JSON error when loading gutefar.se/2simple.html. It seems no JSON at all is loaded. Data should be printed at gutefar.se/2server_processing.php but it is empty. I have tried several ways to solve it, but can't figure out why it don't work.
To see if there is any problem with the sql to the view I made exactly the same query by php from a separate file which gives expected result: gutefar.se/2test.php. So db seems to work fine.
Debug: https://debug.datatables.net/anovop
I'm looking forward to read your suggestions.
Replies
I'd suggest having a look at the server's error log to see if there is anything reported there.
Allan
Thanks for your suggestion. Unfortunately, nothing is written in the log file on my hosting.
Could you add these two lines at the top of your PHP server-side processing file please (inside the
<?php
tag):Allan