Hey,
I would like to exclude some results always. In SQL I would just add “WHERE column != value”, but I cant do this here.
How would I go about doing this? These results should ALWAYS be excluded no matter the search a user runs.
You can specify select_command (sql statement) and put WHERE clause in it. It will always remain in effect along with other grid filters. e.g.
$g->select_command = “SELECT i.id, invdate , c.name,
i.note, i.total, i.closed FROM invheader i
INNER JOIN clients c ON c.client_id = i.client_id WHERE c.gender = ‘male'”;
You can use session variable in sql query in same way. e.g.
$g->select_command = “SELECT i.id, invdate, i.note, i.total, i.closed FROM invheader i
WHERE i.client_id = “.intval($_SESSION[“uid”]);
Thanks for the help, I am so annoyed that I did try just this earlier but it didnt work for me.
Thanks again for the support
Following on from this, it would be handy to understand if it is possible to have a way to use a session (so a login system sitting in front of this) that when someone logs in, they can see a further filtered list.
e.g. User1 logs in and only sees results where the User column equals “User1”