I have a grid that is successfully displaying records, and am trying to update a record. The SQL that is created is wrapping the primary key value (from the first column) in quotes before issuing the statement. The jqgrid_dist.php file contains code where I can see $id being wrapped in single quotes. (The form wouldn't let me paste it in here.)
Why does it assume that the primary key is a string? Is there a way to indicate the column's type, ie integer, so that the update can be prepared properly?
Thank you!
Kelly
I am having the same sort of problem when trying to use the upper row of entry-fields to perform filtering. I want to filter on a value that is an integer and when I enter a value, I get this criteria:
TRIP_NUMBER LIKE '751288%'
but trip_number is a numeric database field, so the statement fails.
Please advise. Thank you.
Kelly
Hello,
I am regenerating this scenario. Will update this ticket again after testing.
Regards,
For update fix, quick solution could be to remove it from lib file. It work well with string in mysql, perhaps not in your case (db2).
Search this line and remove quotes across '$id'
$sql = "UPDATE {$this->table} $update_str WHERE $pk_field = '$id'";
For your searching issue …
$col = array();
$col["title"] = "Id";
$col["name"] = "id";
…
// to perform = searching instead of like, use following setting.
$col["searchoptions"]["sopt"] = array("eq");
Regards,
The table in sql I have is made of two primary keys, to perform the modification in the grid only takes me an update may make based on the two keys, and I do not take the first column as value where
Hello Jose,
Case resolved on chat. To help others i'm pasting the solution.
You need to use custom on_update event for such case.
Refer custom events in http://phpgrid.org/docs
(available in premium version).