MySQL Search Query, Anything but Letters
Posted: Mon Apr 24, 2006 7:30 pm
Can someone please show me the syntax for a query which excludes all entries which do not start with a letter. (a-z/A-Z)
Thank you.
Thank you.
A community of PHP developers offering assistance, advice, discussion, and friendship.
http://forums.devnetwork.net/
Code: Select all
`field` REGEXP '^[a-zA-Z]'Code: Select all
$Query = "SELECT `RecordID`, `Word` REGEXP '^[a-zA-Z]' FROM `TABLE` ORDER BY `Word` asc";Code: Select all
$Query = "SELECT `RecordID`, `Word` FROM `TABLE` WHERE `Word` REGEXP '^[a-zA-Z]' ORDER BY `Word` asc";I think this is doing the opposite of what it needs to do. This is returning all results that DO have the letters a-z as the first character. I tried searching for RegEx that would fix it but had no luck.feyd wrote:Code: Select all
`field` REGEXP '^[a-zA-Z]'