php-general | 2005051
Date: 05/08/05
- Next message: Andy Pieters: "Re: [PHP] I'm having a blond moment with a while loop???"
- Previous message: The Doctor: "Re: [PHP] Question about acessing databases and formatting output"
- In reply to: Ryan A: "[PHP] Between Query (0T)"
- Next in thread: Duncan Hill: "Re: [PHP] Between Query (0T)"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On Sunday 08 May 2005 15:20, Ryan A wrote:
> Hi,
> Sorry I know this is OT but I'm hoping someone will still help...it should
> be quite simple :-)
> I have a field in the database called "age" which is a DATE field.
>
> I also have a webform where the user can select between which ages he wants
> the records shown...
> eg: if he types 23,25 then I should get all results where
> age >=23 and age <=25
>
SELECT * FROM
`table`
WHERE `age` BETWEEN 25 AND 26;
You might want to sanitize your input first.
Like using intval() on your input or mysql_escape_string
Regards
Andy
> Thanks,
> Ryan
>
>
>
> --
> No virus found in this outgoing message.
> Checked by AVG Anti-Virus.
> Version: 7.0.308 / Virus Database: 266.11.6 - Release Date: 5/6/2005
-- Registered Linux User Number 379093 -- --BEGIN GEEK CODE BLOCK----- Version: 3.1 GAT/O/>E$ d-(---)>+ s:(+)>: a--(-)>? C++++$(+++) UL++++>++++$ P-(+)>++ L+++>++++$ E---(-)@ W+++>+++$ !N@ o? !K? W--(---) !O !M- V-- PS++(+++) PE--(-) Y+ PGP++(+++) t+(++) 5-- X++ R*(+)@ !tv b-() DI(+) D+(+++) G(+) e>++++$@ h++(*) r-->++ y--()>++++ -- ---END GEEK CODE BLOCK------ -- Check out these few php utilities that I released under the GPL2 and that are meant for use with a php cli binary: http://www.vlaamse-kern.com/sas/ ----
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
- Next message: Andy Pieters: "Re: [PHP] I'm having a blond moment with a while loop???"
- Previous message: The Doctor: "Re: [PHP] Question about acessing databases and formatting output"
- In reply to: Ryan A: "[PHP] Between Query (0T)"
- Next in thread: Duncan Hill: "Re: [PHP] Between Query (0T)"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

