DataTables - server side: Could not open connection to server
DataTables - server side: Could not open connection to server
Hello everyone,
I am trying to get server side working. I followed these tutorials:
Basically I changed server side script in first example with the second example. I set my tables and database connection.
When I try to run the site I receive error in Firefox JS console:
Severity: Warning
Message: mysql_connect(): Connecting to 3.22, 3.23 & 4.0 is not supported. Server is 4.0.30-log
Error: Could not open connection to server
I use DT Editor without any problems. Is there anything I can do in order to get it working?
Thank you for reading this! :)
Peter
This question has an accepted answers - jump to answer
Answers
I would suggest ignoring the scripts in the /development section of this site - they are all legacy. Indeed that uses the legacy
mysql_connect
method which has been removed in the latest PHP versions.Use the example from the first link you gave if you can. Failing that, just use the Editor libraries. They have built in support for server-side processing :-)
Allan
I would love to use Editor, because it is great. But I need to get working custom SQL query using
group by
, which is not supported according to this thread: http://datatables.net/forums/discussion/22998/does-editor-have-a-groupby-function.So I hoped I could get simple DataTables working with
group by
in my SQL query. :/I do not need to edit that data, just to display them. I can do it without DataTables, but I wanted to use them for convenience.
You mentioned I should use the first example. :) Can I add custom SQL there?
From the first example (http://www.datatables.net/examples/data_sources/server_side.html):
When I enter relevant data, I can see error:
"An error occurred while connecting to the database. The error reported by the server was: SQLSTATE[HY000] [1045] Access denied for user: 'db_userip_address' (Using password: YES)"
The same credentials work for my Editor config.php file.
Maybe it would be best if we leave it here.
I thought I was missing something obvious, but this could cost us a lot more time than I first anticipated, if we continue. :(
Regarding the custom SQL with the SSP class - no, you would need to write the code directly - a bit like the legacy version does, but updated for the new style of parameters...
Allan
Thanks Allan, great support as usually. :)