Howdy all y'all.. I've been lurking in the shadows for quite some time now.. I usually find the answers I need just by snooping around. This time I haven't found the answer I'm looking for so decided, finally, join and post.
Its prolly a question with a ridiculously simple answer that's already posted here somewhere, but like I said, I can't find it, so here goes..
I have a list of data elements that are ordered by a range of numbers. For example:
001 thru 004 = item #1
003 thru 013 = item #2
013 thru 123 = item #3
133 thru 666 = item #4 ... et cetera ad infinitum...
As you can see, there is some overlap between some of the ranges, and there are some numbers that don't fall into any range at all (ex: 125).
*Note: None of this data is in a db yet as I am yet to receive it. I plan on using MySQL once the data's handed off to me.
I guess my question is twofold: I don't know how to get php to find the right item# based on an entered number, and I dont' know how to best set up the db to work with the method of retrieval. Entering "002" should return item #1. Entering "003" should return both items #1 and #2. Entering "125" will return a message stating nothing could be found.
Oh yeah.. I almost forgot.. Some item # will have two or three or four ranges. Example: item#23 = 001-006, 123-555, 678-999
I guess i could create a db that has one row for each number 001, 002, 003, 004, etc... But that seems like it would be too big especially if I'm adding several k numbers.
Should each item have its own row perhaps? And then a field for each the high and low numbers of its range? That wouldn't work because of the multiple ranges some items have - unless i listed each multiple item on multiple rows.
I just don't know where to begin with this. Especially since I don't know quite how to work the php or the MySQL for the task. I always try to think through my method so I don't get up to my ankles in a misguided project.
Doth my question senseth make?
Any help on this would be greatly GREATLY appreciated.
A thousand thanks to any and all who give this little problem of mine even a passing thought.
-Chet23 😕