Ben biraz daha yönetilebilir bir tablo olması için benim mysql tablo biraz optimize etmek için çalışıyorum. Ben bir bit alanı kullanıcı izinlerini saklamak istiyorum.
Örneğin, bir kullanıcının izinleri (I kullanıcı izinleri büyüyen bir dizi var, bu nedenle bu boyu biraz daha uzun olabilir) 0110 olabilir
Örneğin, aşağıdaki uygun olabilir:
0: User cannot post news items on the website 1: User can post new articles on the website 1: User can edit any article on the website 0: User cannot remove articles from the website etc. (for other permissions)
Ben bu bir mysql biraz alanda depolanan varsa. Nasıl bu PHP işleyebilirsiniz?
For example, in PHP is there an easy way to get the 3rd bit and see if it is a 0 or a 1?
Is there an easy way to set the 3rd bit to be a 0 or a 1?