Page 1 of 1

PHP MySQL help needed...

Posted: Mon Jun 22, 2009 9:35 am
by vtvstv
OK I have a search page that shows all rsults from a particular column beginning with A under the heading "A", beginning with B under the heading "B" and so on to Z. but I also want to display all results that begin with 0-9 and special characters under another single heading. (When data is submitted to database I have escaped where neccessary using addslashes().)

What would be the mysql SELECT statement to get all data from a column lets call it `maintitle` that begins with 0-9 and special characters?

Any help on this would be greatly appreciated.

Best Regards

Kai

Re: PHP MySQL help needed...

Posted: Mon Jun 22, 2009 10:34 am
by emix
which special characters? lets assume its ^ and *

Code: Select all

 
select * from table where substring(maintitle,1,1) regexp '^[0-9\^\*]'