On Sat, Mar 27, 2004 at 07:55:31PM -0700, Karl Timmermann wrote:
> Hi,
> 
> I am working on a PHP/MySQL solution to have a webpage where users can 
> rate cigars. I ran into a problem though. One variable that exists is 
> the length of the cigar. In the cigar world, the lengths are usually 
> written like 6 1/8" or 155 mm or 4 15/16" or 125 mm. I don't want to 
> make the length column in the database be a string with data like "6 
> 1/8"" in it, because as the user submits cigars, different users could 
> type it a different way, screwing up searches that are searching by 
> length. I also want to have a real time metric conversion as well.
> 
> So my question is, how should I do this? Should I have a float column 
> with the lengths as mm and it converts it to inches? If so, then how 
> would I convert 155.57500mm to 6 1/8", or 155mm to 6 1/8". It's hard to 
> explain, but I can't come up with a good solution. Please ask if you 
> need clarification.
> 
> Any help is much appreciated!
> 
> Thanks!
> Karl
> 

How about a drop down menu with valid lengths in them? That way you can control
what the user enters.

-- 
Jim Kaufman
Linux Evangelist
public key 0x6D802619
http://www.linuxforbusiness.net
---
If you can't learn to do it well, learn to enjoy doing it badly.
                -- Ashleigh Brilliant

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to