>>>>> "Andreas" == Andreas Gietl <gietl@stripped> writes:
Andreas> hi i'am having a little problem making mysql search for a
Andreas> string that does not completly match the searched field, but
Andreas> does just CONTAIN the search string.
Andreas> Is it possible to realize this withing Mysql or do i have to
Andreas> do this within my programm?
take a look at the mysql info docs, node "String comparison
functions". you should be able to use either "LIKE" or "REGEXP",
depending on how fancy your search criteria are. if you just want to
see whether a field contains a given string, you could use:
| WHERE Field LIKE "%string%"
as your search clause. as an example, to find all tracks that have
the word "rain" in their titles, i can do the following query on my
personal cd database:
| select Artist.name, Album.name, Track.track_num, Track.name
| from Artist, Album, Track
| where Track.album_id = Album.id
| and Album.artist_id = Artist.id
| and Track.name like "%rain%"
| order by Artist.sort_key;
note the 'Track.name like "%rain%"' line. a copy of this schema is at
http://slinky.scrye.com/~tkil/create-tables.sql
good luck,
t.