database query: modifying $where
database query: modifying $where

Hello, I am working with datatables editor, paid version. I am trying to set up the database so that every query is under the condition that only data corresponding to that particular user is retrieved.
In my personal php script (before implementing datatables) I used :
'' $sql = "SELECT id, username, proc, mrn, supervisor, proc_date, note FROM procedures WHERE username='$username'"; ''
I am looking to add:
WHERE username='$username'";
applies to any data retrieved in the table which can then be edited.
I'm unsure of where to add the modification. Can anyone help guide me in the right direction?
Answers
after further research I found in the instructions I can edit the
$editor::inst function in 'php libraries', to this:
$userId = 12;
$editor->where( function ( $q ) {
$q->where( 'id', $userId ); // will throw an error!!
} );
However, I cannot find the
$editor->where
anywhere in any of the code libraries. I used the generator to create my table, I'm not sure if that is complicating me finding it .
This manual page should help - it's explaining the
where
condition. It's contained in the Editor/Options PHP file, so that'll need to be included. You should be able to do something likeor
Colin