SQL-Error when adding an entry – never had this problem before
SQL-Error when adding an entry – never had this problem before
WALTERMedien
Posts: 8Questions: 2Answers: 0
We're recently facing issues when adding a new entry to our table via button. We get the following error:
SQLSTATE[42601]: Syntax error: 7 ERROR: syntax error at or near "as" LINE 1: ...8, $9, $10, $11, $12, $13, $14 ) RETURNING as dt_pkey ^
We never used to have this problem before – and we don't know where it suddenly could come from.
Anybody out here who could help? Thanks!
Kind regards
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
Hi,
Could you let me know:
If you haven't updated to 1.8 (both client and server-side) then it would be worth doing so as we've addressed a few issues like this.
Allan
Hey Allan,
sorry I didn't mention these facts in my question already. We're running CentOS 7.4.1708 on our Server, with PHP 5.4.16 and PostgreSQL 9.5.10. Editor is version 1.5.6.
I took a look at Editor 1.8. Is there anything I need to look for or is it just as simple as replacing old files with new ones?
Kay
From 1.5 it should just be a case of replacing the old files with the new ones. One thing worth noting is that the Editor PHP libraries have changed structure a little. not much, but one or two files such as
Editor.php
have moved up a directory, so you might be best to remove the old library files before installing the new ones.Allan
I tried to remove the old lib files and replaced them with the new 1.8 ones. But now I get the error message "DataTables warning: table id=xxx - Primary key element is not available in data set."
Are there any paths I need to adjust because of the new structure of the PHP lib?
Kay
No. The autoloader will take care of that.
Can you show me the PHP you are using? It sounds like you might be using an Mjoin and the primary key from the source table isn't in the data set.
Allan
Here comes our PHP
Kay
Does anybody else maybe know the problem here? We still couldn't fix it unfortunately. Are there any other informations we could provide to find the problem?
Kay
That is very odd! I don't see anything in your PHP that would cause an issue like this!
Could you change
->process( $_POST )
to be:and then let me know what the JSON data that the server sends is (see this tech note for how to get that information if you aren't sure).
Thanks,
Allan
Hey Alan,
we were able to solve the initial problem. We figured out someone messed up our database sigh. After solving this we were also able to upgrade to Editor 1.8 without any problems. Sorry for the inconveniences.
Kay
No worries. Good to hear you managed to track it down!
Allan