FRe[2]: [PHP-DB] MySQL Regular expression
| From: | Rory McKinley | Date: | Fri, 10 Oct 2003 07:27:47 +0000 |
| Subject: | FRe[2]: [PHP-DB] MySQL Regular expression | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-30952@lists.php.net to get a copy of this message | ||
> HI Owen
>
> I am not sure about strcmp - I have never used it on numbers before..MySQL
> 2nd Ed by DuBois <PLUG> Which is well worth the money - makes me look
> intelligent </PLUG> says that strcmp sorts lexically...and to be quite
> honest, I need to go look that up...... but I think it will work...
>
> However, using the code from your previous comment, you can try casting
your
> result as an unsigned integer like so (if yourMySQL is ver 4.0.2 or up)...
>
> select * from ihrproperties where region = 'Kerry' and 0 <
> CAST(substring_index(substring_index(rates, ',', 41), ',', -1) AS UNSIGNED
> INTEGER) < 1568
>
> If you don't have 4.0.2 - I would suggest you try strcmp and see ...
>
> Rory McKinley
> Nebula Solutions
> +27 82 857 2391
> rorym@nebula.co.za
> "There are 10 kinds of people in this world,
> those who understand binary and those who don't" (Unknown)
> ----- Original Message -----
> From: "O Franssen" <twisteddesign@eircom.net>
> To: "Rory McKinley" <rorym@nebula.co.za>
> Sent: Thursday, October 09, 2003 6:22 PM
> Subject: Re[2]: [PHP-DB] MySQL Regular expression
>
>
> > Actually in response to my previous comment, would the following
> > achieve wwhat I want?
> >
> > ... and strcmp('$foot_budget', substring_index(substring_index(rates,
',',
> $selecteddate), ',', -1)) = -1 and strcmp('$head_budget',
> substring_index(substring_index(rates, ',', $selecteddate), ',', -1)) = 1
> >
> > --
> > Regards,
> > Owen Franssen
> > Twisted Design
mailto:twisteddesign@eircom.net
> >
> >
> >
> >
>