Julian -- There is the generic WHERE keyords ='%string%', but more to the point here the link to the docs for regrex goodies: http://www.mysql.com/doc/manual.php?search_query=regular+expression&submit=S earch&depth=0
David > Hi, > > I have recently gained access to mysql (new isp), and am converting my > old text databases to sql ones. I had a text database with a field > 'keywords'. I have entered them as one field, What I want to do is > submit a query where I can ask if this field CONTAINS rather than > equals a string. Can you use regular expressions in this way? > > I want to have something like > > $result = mysql_query ("SELECT title, keywords, description FROM > documents WHERE keywords='$word'"); > > but with keywords 'contains' '$word' > > a bit like keywords =~ m/$word/g in perl > > How would you all go about this? should I set my database up > differently? Thanks very much! > Jules > > > > > --------------------------------------------------------------------- > Before posting, please check: > http://www.mysql.com/manual.php (the manual) > http://lists.mysql.com/ (the list archive) > > To request this thread, e-mail <[EMAIL PROTECTED]> To > unsubscribe, e-mail > <[EMAIL PROTECTED]> Trouble > unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php -- ************************************************* BASIC DBD/DBI Connect Function: ************************************************* /usr/local/bin/perl -w use strict; use diagnostics; use DBI; $dbh = DBI->connect("DBI:mysql:$dbname",$login,$password) or die "Can't connect to $dbh: $dbh->errstr\n"; $sth = $dbh->prepare("SELECT * FROM catalog") or die "Can't connect to $dbh: $sth->errstr\n"; $sth-> execute() or die "Can't connect to $dbh: $sth->errstr\n"; $sth -> finish(); $dbh->disconnect(); --------------------------------------------------------------------- Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php