I tried to search for an answer to this but couldn't find the problem.
I have a grid which i populate with a select command on my ms sql table.
If I take the full content of the table it works fine, but if i add the WHERE clause then only the last line is selectable and if i delete this line all the lines will be deleted.
I redid the table to add a id column just to try having unique values in the first column.
The following line is the working one:
$gr->select_command = "SELECT id, ref_NO_CLIENT, ref_NO_RUBRIQUE, DESCRIPTION_FR, SEQUENCE FROM Cli_Rub INNER JOIN ATCQ_RUBRIQUES ON Cli_Rub.ref_NO_RUBRIQUE = ATCQ_RUBRIQUES.NO_RUBRIQUE";
And now the line that mess things up: ($CLE contains the NO_CLIENT)
$gr->select_command = "SELECT id, ref_NO_CLIENT, ref_NO_RUBRIQUE, DESCRIPTION_FR, SEQUENCE FROM Cli_Rub INNER JOIN ATCQ_RUBRIQUES ON Cli_Rub.ref_NO_RUBRIQUE = ATCQ_RUBRIQUES.NO_RUBRIQUE WHERE id LIKE '$CLE%'";
Any help figuring why just adding this would mess things up would be appreciated.
The first column of grid must have unique alphanumeric data (usually a PK).
This is required for proper display as well as update & delete operations of particular row.
The first column (id) is my PK and contains unique value in each row.
Like I said the only difference between the 2 queries is the Where clause I added because I want to edit 1 particular client instead of all clients.
If I change it to filter on the client number and hardcode a value (for test purpose) I will still have the same problem…
We are sorry that this post was not useful for you!
Let us improve this post!
Tell us how we can improve this post?