I am having a problem getting AND to work. I have a MySQL database field defined as varbinary(8)
with X00 in it. Then I have define statements with X01 in it.
define('CERTACC ESS_MEDALS', x01);
Then I run the data through a function
function SecurityLevel_C heck($security_ byte, $securitylevel_ bit) {
//AND = 1 IF BOTH are 1
return $security_byte And $securitylevel_ bit; }
if(SecurityLeve l_Check($record Set_cert->fields['certcode_acces s'], CERTACCESS_MEDA L) == 1) {
No matter what the values are it always returns a 1. I've looked and looked at the docs and cannot
figure out what I am doing wrong. I tried AND and & and both produce different but wrong results.
PLEASE throw me a bone of a hint at what I am doing wrong.
Thanks.
Mike
with X00 in it. Then I have define statements with X01 in it.
define('CERTACC ESS_MEDALS', x01);
Then I run the data through a function
function SecurityLevel_C heck($security_ byte, $securitylevel_ bit) {
//AND = 1 IF BOTH are 1
return $security_byte And $securitylevel_ bit; }
if(SecurityLeve l_Check($record Set_cert->fields['certcode_acces s'], CERTACCESS_MEDA L) == 1) {
No matter what the values are it always returns a 1. I've looked and looked at the docs and cannot
figure out what I am doing wrong. I tried AND and & and both produce different but wrong results.
PLEASE throw me a bone of a hint at what I am doing wrong.
Thanks.
Mike
Comment