How could I do a search on my PHP / MySQL site?

When someone searches my site using the quick search feature, I would like to write it to my database

  • Obviously, I want to see what my users are looking for.
  • I can create a tag cloud based on these searches.

I have a table searchtermsat the moment with two fields: idand terms, I was wondering if this was the best way to record this information. termsbecomes a little redundant.

any hints or links to related scripts?

Thanks guys,

+3
source share
2 answers

, Google Analytics , . API .

- javascript. , .

, , , .

+2

( , - "" , , , ...) , ?

, "" "", ; "éléphant" "", .

terms
  - id
  - word

terms_searched
  #id _term
  - time_search

, , SQL-,

select id, term, count(*)
from terms
    inner join terms_searched on terms_searched.id_term = terms.id

, where, , , ?

, , , "num_times_searched", ,

+3

Source: https://habr.com/ru/post/1713586/


All Articles