tags:

views:

87

answers:

2

i have table titled gorups have posting enum('yes','no') delete enum('yes','no') in the gorups table

how i can make Permission system in php this mean

when write

if(Permis['posting']=='yes'){
echo ok;
}
+2  A: 

Check out this question or this and maybe this.

Pekka
+3  A: 

Assuming your are using MySQL, why not use BOOLEAN or the equivalent TINYINT(1) instead of ENUM? There is no reason to use strings 'yes' and 'no' when they are really booleans true and false.

Stuff like that can be handled through an ACL. One implementation of an ACL in PHP is Zend_Acl. If you do not want to use an ACL but just your database and your own code, you would have to write some code that queries your database for the permission of the Group, e.g. SELECT posting from Groups where id = [groupId].

Gordon
yes its good but i made the table enum i cant change all this
moustafa
sure you can. embrace change :)
Gordon