PHP error
PHP error
menashe
Posts: 183Questions: 43Answers: 2
in DataTables 2
I keep getting the error message shown below:
I am assuming that it is because the value for parameter 5 (item_id) is not surrounded by quotes, but I cannot figure out how to fix.
Thanks.
Answers
I'm not sure to be honest! There is nothing that immediately stands out as wrong there.
Can you show me:
Thanks,
Allan
Oh boy! The PHP Editor file is easy--but big.
My web site used to display Table A, which then had one or more children from Table B, which in turn had one or more from Table C... This went five or so levels!
I decided that was a ridiculous way to enter data (on five different Editor forms), so I JOINed everything together in the included PHP.
I am not sure what I would give you as a SQL dump.
By the way, the issue occurs for ADDing; EDITing and existing record works.
Could you replace the contents of the
DataTable/Driver/PostgresQuery.php
file that you have with the below please?It won't fix the issue - rather it adds some more debug - I'm wondering if it is the primary key query that is the issue.
With that change in place, could you execute an edit command and then copy / paste the full JSON from the response here please?
Here you go. I assume that you meant ADD, not EDIT; the Edit didn't produce this JSON.
(I could not figure out how to retain the JSON formatting.)
I think it is this:
Could you replace with:
More correctly, I think the query to get the primary key name isn't correctly doing a split on the name if an alias is used, without the
as
. That is something I can look at fixing (assuming this addresses the issue!).Allan
Same error.
I keep looking at the JSON. Every single value is surrounded by quotes, except for the "item_id".
Why is that? Isn't that the issue?
I don't really see why an integer rather than a string would make a difference, but then I also don't see anything else that is causing an issue!
Could you try this varient please? I've converted the integer to be a string and corrected the debug order.