mysql search query

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • WindAndWaves

    mysql search query

    Hi Gurus

    Is there a way to search for a word in any of the fields of a row using simple sql for my sql?

    I have a rather complex search function on my site and right now, I dump all the text of all fields (that are text fields) in a
    special field. The search function then searches this "keyword" field.

    Is there a smarter way of doing this.

    To recoup

    I have an mysql database with about 500 records, each containing over 20 text fields (address, name, etc.... etc....). I want the
    user to be able to search for a particular word (e.g. fishing or rock climbing) in all records and all fields and I would like Mysql
    to return the IDs of the fields that match.

    Along the lines of

    SELECT ID FROM TABLE WHERE * LIKE "%test%";


  • skrebbel

    #2
    Re: mysql search query

    "WindAndWav es" <access@ngaru.c om> wrote in message
    news:V20Kd.1214 9$mo2.932708@ne ws.xtra.co.nz.. .[color=blue]
    > Hi Gurus
    >
    > Is there a way to search for a word in any of the fields of a row using[/color]
    simple sql for my sql?[color=blue]
    >
    > I have a rather complex search function on my site and right now, I dump[/color]
    all the text of all fields (that are text fields) in a[color=blue]
    > special field. The search function then searches this "keyword" field.
    >
    > Is there a smarter way of doing this.[/color]



    -skr


    Comment

    Working...