469,927 Members | 1,672 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,927 developers. It's quick & easy.

Filtering special-chars

Hello,

I want to fetch the page via php from a mysql-db, which is called by an
emulated filename (mod_rewrite, but that might be unimportant).
So I have a file, which is called by guestbook.html - so I have to find the entry
in my db, where the page title is guestbook. But there isn't a only column for
this virtual filenames, but only entries like "Guestbook", "This & much
more..." and so on.
Becaus I'm not able to use "This & much more..." or thinks like this as
filenames, I have first have to bring the letters to lower case and then to filter
all the special chars. but how can i do this?

because it is for a german cms, I first translate ,,,

my current solution (whitout replacing special chars) is this:

WHERE
REPLACE (
REPLACE (
REPLACE (
REPLACE (
LOWER( pagetitle ) ,
'', 'oe'),
'', 'ae'),
'','ue'),
'','ss') LIKE 'guestbook'
the column pagetitle has in one entry the value "Guestbook" - but how can i
find a entry "This & much more..." - how to delete whitespaces, &, . and the
other chars that are not numbers or digits?

doing this at reading from the db has the benefit that I don't have to do so
many hacks in the cms as when I would do it at inserting. The problem of the
performance might be not so heavy (if I wouldnt have to use much more
Replace (...)), becaus the cms is just for small pages which are hosted on
shared hosting servers.

thanx for your help,
Steffen

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/my***********...ie.nctu.edu.tw

Jul 19 '05 #1
0 1673

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Alex Ayzin | last post: by
10 posts views Thread by milk-jam | last post: by
2 posts views Thread by Konrad | last post: by
2 posts views Thread by JUAN ERNESTO FLORES BELTRAN | last post: by
3 posts views Thread by Zethex | last post: by
reply views Thread by Zethex | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.