Reply to Re: Problem with AND &

Your name:

Reply:


Posted by Mike on 02/06/06 04:09

I made the changes in the database records and in the defines. Same thing happens. Everything
equates to a 1.


"Jerry Stuckle" <jstucklex@attglobal.net> wrote in message
news:y8ydnXXKi4H453jenZ2dnUVZ_sSdnZ2d@comcast.com...
Mike wrote:
> 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('CERTACCESS_MEDALS', x01);
>
> Then I run the data through a function
>
> function SecurityLevel_Check($security_byte, $securitylevel_bit) {
> //AND = 1 IF BOTH are 1
> return $security_byte And $securitylevel_bit; }
>
> if(SecurityLevel_Check($recordSet_cert->fields['certcode_access'], CERTACCESS_MEDAL) == 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
>
>

x01 is a string containing the characters "x', '0' and '1'.

0x01 is a one (or more) byte value with the lowest order bit on (and the
rest off).


--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация