mysql - Prevent database table row from delete and update -
mysql - Prevent database table row from delete and update -
this question has reply here:
protect row deletion in mysql 2 answersi have database table want protect rows deleting , updating. using mysql database. how can prepare in phpmyadmin or sql syntax?
ex: prevent row id:18
delete , update:
you have various options.
session wise: if using innodb
set autocommit=0; update table set mainpage =1 id = 18; -- not commit until want release lock. -- if under myisam, -- think going lock whole table (to verified)
structural protection
create trigger before update/delete on table , raise error when :new.id = 18
mysql phpmyadmin
Comments
Post a Comment