Home > Mobile >  Adminer - Limit user to change only certain rows
Adminer - Limit user to change only certain rows

Time:12-14

I want to use Adminer Editor to allow users to change rows in one table. I use this function to limit users to see only the table I want:

function tableName($tableStatus) {
    if($tableStatus['Name']==$TABLE_NAME)
        return $TABLE_NAME;
}

But - I want the users to change only rows with a certain condition (for example: branch_id=10). Who can I do this?

CodePudding user response:

You can use the following query To limit users to only modifying rows with a certain condition

UPDATE table_name
SET column1 = value1, column2 = value2, ...
WHERE branch_id = 10

CodePudding user response:

I found an ugly way to do it:

function selectQueryBuild($select, $where, $group, $order, $limit, $page){
    return "SELECT * FROM `TABLE_NAME` where BRANCH_ID=10";
}

Unless someone has a better solution, this changes all the query that will be done but it'll do the job.

  • Related