If this is your first visit, be sure to check out the FAQ by clicking the link above.
You may have to register before you can post: click the register link above to proceed.
To start viewing messages, select the forum that you want to visit from the selection below.
Ok i've never been good with regexp but need some help. What i need to do is get a query to a database that looks at the last number of a sequance of numbers and compares it to a prefined number that will be passed via PHP.
So for example i have a variable (in php) contianing 1,2 and need to find any results in the table base that has a sequance of numbers in a field that can contain anywhere from 5 - 7 numbers. (e.g. 12345 or 123456 or 1234567).
What i do know is that i can find the last digit using the $ but am lost trying to figure out how to get the query put together under this situation.
Any help would be very much appreciated as i need to get this done asap.
your variable contains '1,2' and you want to find that string where? does the found column value have to have 5-7 digits, or will you also want to see values that might have fewer?
All i realy need is to locate any numbers in the field that end with a particular number. So in the example would be 1 or 2 (these will change with PHP but will always be 2 numbers).
The query will return the entire record and not just this number. I'm using it in a where clause to reduce the overall number of returns on the query. So above if i was looking for any records with the numbers 7 or 8 i would retunr the ID's 4 and 6 and none of the other records.
I'm not sure i totaly understand what your asking for i hope that was it.