ryanschefke Posted August 23, 2008 Share Posted August 23, 2008 Hello, I already have the following query working successfully. I am looking to add a search capability to only pull the rows where the string in the "state" column of my database is part of a large amount of text. In other words, Users will specify that they only want to see rows where the state column is Michigan, Ohio, Texas, California, Florida, etc... My two questions are: 1) How should I be storing the text in MySQL for the states they want to see? Separated by commas (Michigan, Texas, Ohio...) or just bunched together with no spaces (MichiganTexasOhio...) or a different way? I could store it in any way. Is there a certain format I should store it in, Text, Blob, etc to make it searchable? 2) What would I need to add to the query below to make this search and do it fast? Basically, a search with this logic "only pull the rows where the value in the state column is included in a paragraph of text" $query = "SELECT v.organization, v.city, v.region, v.country, DATE_FORMAT(v.dateTime, '%m/%d/%Y %l:%i %p'), v.visitorID, v.searchWords, COUNT(h.hitID) as sumHits FROM visitors as v, hits as h WHERE v.customerID='$customerID_ck' AND cast(v.dateTime as date)='$sGMTMySqlDate' AND h.visitorID=v.visitorID GROUP BY h.visitorID ORDER BY $sort LIMIT $start, $displayToday"; Link to comment Share on other sites More sharing options...
fenway Posted August 25, 2008 Share Posted August 25, 2008 Solved how? Link to comment Share on other sites More sharing options...
ryanschefke Posted August 26, 2008 Author Share Posted August 26, 2008 Well, not really I just don't know how to delete it an no one was responding to my post. Link to comment Share on other sites More sharing options...
fenway Posted August 26, 2008 Share Posted August 26, 2008 This feels very much like the same issue as you posted in this thread. Link to comment Share on other sites More sharing options...
Recommended Posts