★ wanayoo — archive 1999 http://www.devshed.com/Talk/Forums/Forum5/HTML/000097.htmlNouvelle recherche | Portail wanayoo
DevShed Menu
* DevShed Home
* Developer News
* DevShed Brain Dump




UBBFriend: Email This Page to Someone!
  DevShed Discussion Forums
  PHP
  Unsigned integers

Post New Topic  Post A Reply
profile | register | preferences | faq | search

next newest topic | next oldest topic
Author Topic:   Unsigned integers
davidn
Junior Member
posted July 31, 1999 02:44 AM     Click Here to See the Profile for davidn     Edit/Delete Message Reply w/Quote
I'm not sure how to handle this one, and I've tried what to me are the most obvious solutions, but so far none have proved entirely satisfactory. I must be overlooking something very simple, since it isn't mentioned in any literature on PHP that I've researched.

I have a value which is essentially a bitmask although a little more complex. Perhaps a better description would be "encoded value". I store this in a field in a mysql database, but the problem I have is that I need to edit it. It is broken apart, and converted to various html widgets within the application, reassembled and submitted via an sql update to the database.

The problem occurs when (this is a 32 bit machine - an intel PII) the 'sign' bit is set in the encoding process. I can't find any way of printing the UNSIGNED value of this bit - whether I print in hexadecimal (which I would have thought to always assume it is an unsigned quantity by default) or decimal, I can't seem to do it. But I need to find a way so that it will successfully update.

I'm starting to think the best way to handle this is by using functions from the sql interpreter, but I'm worried that if I do, I'll make my code (which uses phplib-7) less database 'portable'.

Any thoughts or comments welcome, either by email or here.

All times are MST (US)

next newest topic | next oldest topic

Administrative Options: Close Topic | Archive/Move | Delete Topic
Post New Topic  Post A Reply
Hop to:

Contact Us | DevShed.com

Copyright © 1997-2000 ngenuity. All rights reserved.

Powered by: Ultimate Bulletin Board, Version 5.41a
© Infopop Corporation (formerly Madrona Park, Inc.), 1998 - 1999.