desdemona Posted November 17, 2004 Posted November 17, 2004 Hello, If I add a field into the table 'products' how can I make my search engine search this table contents too? I just altered this in advanced_search_results.php, is this alright? $keyword = tep_db_prepare_input($search_keywords[$i]); $where_str .= "(pd.products_name like '%" . tep_db_input($keyword) . "%' or p.products_model like '%" . tep_db_input($keyword) . "%' or m.manufacturers_name like '%" . tep_db_input($keyword) . "%'"; $where_str .= " or p.newfield like '%" . tep_db_input($keyword) . "%'"; if (isset($HTTP_GET_VARS['search_in_description']) && ($HTTP_GET_VARS['search_in_description'] == '1')) $where_str .= " or pd.products_description like '%" . tep_db_input($keyword) . "%'"; $where_str .= ')'; break; Thanks for help, Ethel
wizardsandwars Posted November 17, 2004 Posted November 17, 2004 Looks pretty close. Have you tried it? ------------------------------------------------------------------------------------------------------------------------- NOTE: As of Oct 2006, I'm not as active in this forum as I used to be, but I still work with osC quite a bit. If you have a question about any of my posts here, your best bet is to contact me though either Email or PM in my profile, and I'll be happy to help.
desdemona Posted November 17, 2004 Author Posted November 17, 2004 Yes I tried and it works...but I still wanted to ask a pro to make sure. Don't I have to add the field in a sql_query-line above? That's really it? Thank you, Ethel
desdemona Posted November 17, 2004 Author Posted November 17, 2004 sorry, again... don't I have to define the keywords or the new fields anywhere else? or in any other file?
developer_x Posted December 3, 2004 Posted December 3, 2004 sorry, again...don't I have to define the keywords or the new fields anywhere else? or in any other file? <{POST_SNAPBACK}> hi, well in my opinion, u dont have to enter the new fields in anywhere else. u have entered the field(s) at the rite place. i have done the same for a new field of products table of my client's database. it works perfectly. cheers, Irfan Irfan,
Recommended Posts
Archived
This topic is now archived and is closed to further replies.