Getting all numbers from DB
Posted: Fri Jan 06, 2006 10:28 am
Hi, I have a slight problem, one I can't really figure out. I have tried to search for the solution, but I just didn't know what to search for. I'm pretty much a PHP n00b, but I'm learning :p
Anyway, what I'm am doing is getting all names from a DB beginning with a certain letter like:
I want to do the same thing with numbers.. I know I can just put 1% in, but I want to get all names beginning with a number, regardless of what the number is, (0-9).
There's probably a simple solution to this, but what that might be, I hope you can tell me, or at least give me some guidelines on how to figure it out.
Thanks in advance!
Anyway, what I'm am doing is getting all names from a DB beginning with a certain letter like:
Code: Select all
$result = mysql_query("SELECT * FROM test WHERE name LIKE 'a%'");
while($row = mysql_fetch_array($result))
{
echo $row[name'];
}There's probably a simple solution to this, but what that might be, I hope you can tell me, or at least give me some guidelines on how to figure it out.
Thanks in advance!