Thanks to everyone for being so helpful with this solution.
Douglas
--
Douglas R. Brantz
Computer Consultant
Fine & Applied Arts
Appalachian State University
Boone, NC 28608
828-262-6549 (office)
828-262-6312 (fax)
-----Original Message-----
From: Matthew Walker [mailto:mwalker@stripped]
Sent: Tuesday, January 29, 2002 3:46 PM
To: Douglas Brantz; mysql@stripped
Subject: RE: Pattern Matching Problem
SELECT schdays FROM courses WHERE (schdays LIKE "M") OR (schdays LIKE
"W") OR (schdays LIKE "F")
Matthew Walker
Ecommerce Project Manager
Mountain Top Herbs
-----Original Message-----
From: Douglas Brantz [mailto:brantzdr@stripped]
Sent: Tuesday, January 29, 2002 1:15 PM
To: mysql@stripped
Subject: Pattern Matching Problem
Hello,
I have a big problem! I need to match all patterns in schdays from a
variable schdays and if schdays = mwf it only turns up mwf and not all
entri
es containing M, W or F. Is there a way to do this?
mysql> select schdays from courses where schdays LIKE "%MWF%";
+---------+
| schdays |
+---------+
| MWF |
+---------+
1 row in set (0.00 sec)
mysql> select schdays from courses where schdays LIKE "%M%";
+---------+
| schdays |
+---------+
| MWF |
| MW |
| MW |
| M |
| M |
+---------+
5 rows in set (0.00 sec)
I need to be able to say select schdays from courses where schdays LIKE
"%schdays%"
H
ere is my code from the program:
my $sth2 = $dbh->prepare("select
id,schdays,time_to_sec(timein),time_to_sec(time
out) from courses where schdays LIKE \"\%$cschdays\%\" AND
done=\"Yes\"....etc..
So I need to be able to match any pattern with $cschdays.
Do I need to parse out the letters and pattern match each one?? It
should be easier.
Thanks,
Douglas
brantzdr@stripped
--
Douglas R. Brantz
Computer Consultant
Fine & Applied Arts
Appalachian State University
Boone, NC 28608
82
8-262-6549 (office)
828-262-6312 (fax)
---------------------------------------------------------------------
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 <mysql-thread97889@stripped>
To unsubscribe, e-mail
<mysql-unsubscribe-matt=mountaintopherbs.com@stripped>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
---
Incoming mail
is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.317 / Virus Database: 176 - Release Date: 1/21/2002
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.317 / Virus Database: 176 - Release Date: 1/21/2002
---------------------------------------------------------------------
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 <mysql-thread97897@stripped>
To unsubscribe, e-mail
<mysql-unsubscribe-brantzdr=appstate.edu@stripped>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php