简体   繁体   中英

Adminer - Limit user to change only certain rows

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?

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

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM