Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Search keyword in database


cr0co

Recommended Posts

Hello

 

I want to Put the Search Keyword in the database, and create a Search Tag Cloud,

 

I have this code: 

if (($_GET['keywords'] != '')) {
 $search_count = tep_db_query("select search, freq from customers_searches where search = '". $_GET['keywords'] . "' and language_id='". $languages_id . "'");
  if (!tep_db_num_rows($search_count)) {
   tep_db_query("insert into customers_searches (search, freq, language_id) values ('". tep_db_input($_GET['keywords']) ."',1," .$languages_id." )");
    } else {
    $search_val = tep_db_fetch_array($search_count);
 tep_db_query("update customers_searches set freq = " . ($search_val['freq']+1) . " where search = '". tep_db_input($_GET['keywords']) . "' and language_id='". $languages_id . "'");
      }
    }

But it puts only the keywords in the database, where Products exists.

i want to put both of them, exist or not.

 

can anybody help me out here?

 

 

Greetings from Swiss

Link to comment
Share on other sites

there is a contribution that logs keywords in the database start from there

KEEP CALM AND CARRY ON

I do not use the responsive bootstrap version since i coded my responsive version earlier, but i have bought every 28d of code package to support burts effort and keep this forum alive (albeit more like on life support).

So if you are still here ? What are you waiting for ?!

 

Find the most frequent unique errors to fix:

grep "PHP" php_error_log.txt | sed "s/^.* PHP/PHP/g" |grep "line" |sort | uniq -c | sort -r > counterrors.txt

Link to comment
Share on other sites

hello bruyndoncx

 

yes, but this contribution is outdated, so i use the code above to only log the keywords in the database.

but it logs not the keywords where no products are found. i want the search keywords not the product tags.

 

Can you help me ?

Link to comment
Share on other sites

let me get this straight

 

you post a section of code that looks in a custom searches table that gets sometimes inserted values, sometimes updates

 

it does not work as you would like

 

something about products not existing/not found

 

now - where is the rest of the code, I can't see any reference to products in this piece of code

 

also it is not clear where you got this piece of code and what other (outdated) code -- in your opinion -- does not work

 

lots of versions, lots of contributions floating around.

 

So

1) what is your version

2) what did you look at ?

3) where did you get this code

4) where is the rest of the advanced search results code ? (assuming you are working on that page ???)

KEEP CALM AND CARRY ON

I do not use the responsive bootstrap version since i coded my responsive version earlier, but i have bought every 28d of code package to support burts effort and keep this forum alive (albeit more like on life support).

So if you are still here ? What are you waiting for ?!

 

Find the most frequent unique errors to fix:

grep "PHP" php_error_log.txt | sed "s/^.* PHP/PHP/g" |grep "line" |sort | uniq -c | sort -r > counterrors.txt

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...