|
|
||||||
|
||||||
| Index Link To US Private Messages Archive FAQ RSS | ||||||
| Database Discussion Forum This is the place to find help resolving those nagging questions you have about implementing and using all kinds of databases. Need help writing a query? Need an opinion on Oracle? Post here! |
Share Thread: & Tags
|
||||
|
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
||||
|
I set up a database to have a searchable range of numbers. I have table set up that has an X column and a Y column. The X equals the low side of the range and the Y the high side.
How do I create a mySQL query that will search for one number within that range? For example: ITEM = Item 1 X = 3 Y = 5 ITEM = Item 2 X = 2 Y = 3 Search Variable = 4 Results: Item 1 Let me know if this is unclear. Thanks, Rich
__________________
Me |
|
|||
|
Hi,
Unless I'm misunderstanding your question, I think what you would want to do is this: $result = mysql_query("SELECT ITEM FROM table WHERE X > $SearchVariable AND Y < $SearchVariable"); Hope that helps... |
![]() |
|
| Thread Tools | |
| Display Modes | |
|
|
|
WebProWorld |
Advertise |
Contact Us |
About |
Forum Rules |
MVP's |
Archive |
Newsletter Archive |
Top |
WebProNews
WebProWorld is an iEntry, Inc. ® site - © 2009 All Rights Reserved Privacy Policy and Legal iEntry, Inc. 2549 Richmond Rd. Lexington KY, 40509 |