Editor update error
Editor update error
rwgreenwood
Posts: 43Questions: 13Answers: 0
I am getting an error trying to get a record updated via the Editor. My debugging has gotten me this far:
Binding: {:num_people} as {4}
Binding: {:craft} as {Driftboat}
Binding: {:put_in} as {Wilson}
Binding: {:take_out} as {South Park}
Binding: {:launch_time} as {8:00:00}
Binding: {:client_name} as {Me}
Binding: {:client_info} as {You}
Binding where: {:where_0} as {1452}
UPDATE reservations SET num_people = :num_people, craft = :craft, put_in = :put_in, take_out = :take_out, launch_time = :launch_time, client_name = :client_name, client_info = :client_info WHERE reservations.id = :where_0
{"error":"SQLSTATE[22P02]: Invalid text representation: 7 ERROR: invalid input syntax for integer: \"\""}
I really don't know which column is causing the error. There are many columns in the table that are not included in the editor. The only integers I can see in my columns are num_people and the id (where) . Any ideas? Thanks in advance.
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
I have it narrowed down to the fact that I have a where set in my server-side PHP script for the editor, like this:
->where('xid', $xid, '=')
If I comment that out, everything works.
So I have to think about what question to ask - something around refreshing the datatable after an editor update and maintaining the parameter for the where.
Hi,
Thanks for the debug information. If it all works without the
where()
method call, the thing that jumps to mind is what is$xid
. The debug above suggests it might be an empty string, although the trace above that suggests otherwise.Can you just confirm what
$xid
is?Could you also show me the PHP code you are using for the Editor instance?
Allan
Thanks for the quick reply. You are right - I figured out that I wasn't getting the data needed for the where ($xid). So I found my answer in implementing a preSubmit event for the editor and passing the data in for $xid.