Use regular expressions or LEFT. This might work
 
SELECT code FROM links WHERE LEFT($text,1) IN (1,2,3,4,5,6,7,8,9,0);
 
Check the manual for regular expression examples. They will probably
work better.
 
---John Holmes.
 
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] 
Sent: Tuesday, May 21, 2002 6:28 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Searching for any number in a mysql query
 
This isn't a one hundred percent PHP Q but here I go.
 
If I have the following query:
$query = "SELECT code FROM links WHERE ".$text." like '".$l."%' ORDER BY
sort_text";
and define the letter a letter i.e x.
it works fine.
I am not sure what to do if I want to say get something that starts with
(from one to ten).
I want to say all the numbers at once, not one at a time.
Any help appreciated,
JJ Harrison
[EMAIL PROTECTED]
www.tececo.com


Reply via email to