G
Guy
A user submits a few keywords to search, for example "red barn". I push
these words in the array @words.
I then want to search through each record of my text database to see if any
of those keywords (up to four keywords) appear in the description of the
photos.
I would suspect there is a better way. Would there be a simple way to check
all submitted keywords, assuming the user could only submit a 50 character
string?
I suppose too that PDS may not be very descriptive for a hash. Do I need
quotes around PDS?
Note too that this is an array of hashes since $j is sequential between 0
and n-1.
if ( $info[$j]{'PDS'} =~ /$words[0]|$words[1]|$words[2]|$words[3]/ )
Thanks for any and all info,
Guy D.
these words in the array @words.
I then want to search through each record of my text database to see if any
of those keywords (up to four keywords) appear in the description of the
photos.
I would suspect there is a better way. Would there be a simple way to check
all submitted keywords, assuming the user could only submit a 50 character
string?
I suppose too that PDS may not be very descriptive for a hash. Do I need
quotes around PDS?
Note too that this is an array of hashes since $j is sequential between 0
and n-1.
if ( $info[$j]{'PDS'} =~ /$words[0]|$words[1]|$words[2]|$words[3]/ )
Thanks for any and all info,
Guy D.