Re: MySql number/string comparing ideas...
| From: | Brad Wright | Date: | Wed, 25 Jul 2001 07:43:14 +0000 |
| Subject: | Re: MySql number/string comparing ideas... | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-59507@lists.php.net to get a copy of this message | ||
elias,
I would have to agree with Lawrence, and recommend re-designing your
database, unless there is a specific reason preventing you doing this (ie
like months of your life invested in the product ; )
otherwise, only allowing numerical input is a good start tho :)
brad
> From: "elias" <elias_bachaalany@yahoo.com>
> Date: Wed, 25 Jul 2001 10:22:32 +0200
> To: php-general@lists.php.net
> Subject: Re: [PHP] MySql number/string comparing ideas...
>
> well yes,
> somehow my field has like:
>
> field1
> ------
> 1.2
> 99.123
> 500x120
> 561x112
> 5.5
>
> so as you see this 'field1' have both normal numeric values and sometimes
> 'YYYxYYY' values...
> I thought that MySql can somehow compare XXXX with another number YYYY and
> compare correctly YYYYxYYYY with anoter value just like it: ZZZZxZZZZ
> anyway...I just forgot about it and droped the YYYxYYY from my table and
> only allowed numerical input,
>
> The problem is that I'm using the same field for two type of data storage...
>
> "Brad Wright" <bradwright@optushome.com.au> wrote in message
> news:B784A52C.133D%bradwright@optushome.com.au...
>> I would use something like this:
>>
>> Select * from table where value1 < 500 AND value2 < 100
>>
>>
>> hope this helps,
>> brad
>>
>>> From: "elias" <elias_bachaalany@yahoo.com>
>>> Date: Fri, 13 Jul 2001 07:06:26 -0700
>>> To: php-general@lists.php.net
>>> Subject: [PHP] MySql number/string comparing ideas...
>>>
>>> Hi!
>>>
>>> How is it possible to do a MySql query for something like:
>>>
>>> SELECT value from table WHERE value < '500x100'
>>>
>>> should return all values that part1 must be less than 500 and part2 less
>>> than 100? like 499x99 and reject something like: 500x101
>>>
>>> please give me suggestions!
>>>
>>>
>>>
>>>
>>>
>>> --
>>> PHP General Mailing List (http://www.php.net/)
>>> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
>>> For additional commands, e-mail: php-general-help@lists.php.net
>>> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>>>
>>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>