Hi All,
I'm trying to select from a table by doing a bitwise compare but it does not work. Here is the sql select statement i have in my php script...
$Mask = implode($aom);
$sql = "SELECT * FROM dbtable WHERE ('".$Mask."' & Code)";
Basically; SELECT * FROM dbtable WHERE ('10100000000000' & Code)
$Mask is a 14 character string of ones and zeros i.e. "10100000000000"
Code is also a 14 character string field in the table similar to $Mask.
I want to do a bitwise compare of $Mask & Code with the "And" operator to test if Bits that are set in both $a and $b are set or true. if so, then get the record.
10100000000000=$Mask
10100000000001=Code
--------------
10100000000000=true
10100000000000=$Mask
00000100100000=Code
--------------
00000000000000=false
Like i said, the way i have it does not work. Is it because you can't do a bitwise compare on two strings?
A little help would be appreciated.