PHP MySQL help needed...

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
vtvstv
Forum Newbie
Posts: 10
Joined: Sun May 24, 2009 3:19 am

PHP MySQL help needed...

Post 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
User avatar
emix
Forum Newbie
Posts: 8
Joined: Mon Jun 22, 2009 10:32 am
Location: Poland

Re: PHP MySQL help needed...

Post by emix »

which special characters? lets assume its ^ and *

Code: Select all

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