flashmajic Posted March 10, 2006 Share Posted March 10, 2006 Hii am trying to created a search function.A users types in the search word and search through the content fieldWhat i would like to achieve is to be able to count the number of occurences the search words appears in one record.I do not want to do something like this:SELECT pages.pgID, pages.pgTitle, Count(pages.pgDesc) AS CountOfpgDescFROM pagesGROUP BY pages.pgID, pages.pgTitleHAVING (((Count(pages.pgDesc)) Like '*talk*'))i actually want to be able to count the number of times the word talk appears in each record if any.Would any have a ny clues on how i could do this in SQL Ascess or using ASPAll i need is some direction.Thanks. Link to comment Share on other sites More sharing options...
arief_anang Posted March 13, 2006 Share Posted March 13, 2006 hi,with php you can use script like this :...$query="Select * from tablename"; $hasil = mysql_query($query); while($barisdata = mysql_fetch_array($hasil)) { print substr_count($barisdata["fieldname"], "wordyoucount"); }...Regards,Anang Link to comment Share on other sites More sharing options...
flashmajic Posted March 14, 2006 Author Share Posted March 14, 2006 How would i do it in asp??? Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now