SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    ********* Member website's Avatar
    Join Date
    Oct 2002
    Location
    Iceland
    Posts
    1,238
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Creating custom functions

    Hello

    I have a column (varchar) that when in querys I need to take all icelandic letters and turn them into normal, I thought I should do this with my custom function but I just don't get it how they work.

    Lets say some column includes field that has the value of 'Ágúst Jónsson'
    Then I need to be able to do

    SELECT column WHERE MyCustomFunction(column) = 'Agust Jonsson'
    and it would return the field.

    How would I create this so I don't need to do REPLACE() million times around the column ?
    - website

  2. #2
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,220
    Mentioned
    58 Post(s)
    Tagged
    3 Thread(s)
    why can't you just say

    SELECT column WHERE column = 'Ágúst Jónsson'

    maybe i'm missing something

  3. #3
    ********* Member website's Avatar
    Join Date
    Oct 2002
    Location
    Iceland
    Posts
    1,238
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This is something i intent to place in the user search so that if the search string doesn't return any result it will search again and compare all names without icelandic letters...
    - website

  4. #4
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,220
    Mentioned
    58 Post(s)
    Tagged
    3 Thread(s)
    perhaps this php function might help?

    http://f2o.org/forum/viewtopic.php?t=1146

  5. #5
    ********* Member website's Avatar
    Join Date
    Oct 2002
    Location
    Iceland
    Posts
    1,238
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    yes, but this has to be done in the query so php function doesn't help me. Is there any way to do this with mysql ?, it is just a mysql REPLACE() functions grouped togeather, I only need to create one function out of group of them, can that be done?
    - website


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •