SQL LIKE problem using PHP and MySQL

Associate
Joined
11 Jun 2004
Posts
42
Location
Staffordshire
Hi guys!

Could really do with some help on this one. Im trying write a query to search for anything that starts with a number, and has any other characters following. It sounds easy I know but its driving me crazy.

Ive got the following atm:
SELECT DVDname, Director FROM DVD WHERE DVDname LIKE '[0-9]%' ORDER BY DVDname;

Can anyone see what im doing wrong please? Im using PHP4 with MySql5.

Thanks.
 
Thanks for that. Managed to get it sorted. Solution was the following, just in case anyone else gets the problem:

SELECT DVDname, Director FROM DVD WHERE DVDname REGEXP '[0-9].*' ORDER BY DVDname;
 
Back
Top Bottom