<%@ Language="VBscript" %> <% search_string = request.form("searchstring") if (search_string <> "") then count = 1 search_st = "" do while (count <= len(search_string)) if (mid(search_string,count,2) <> " ") then search_st = search_st & mid(search_string,count,1) count = count + 1 else count = count + 1 end if loop count = 1 search = "" do while (count <= len(search_st)) if ((mid(search_string,count,1) <> chr(39)) and (mid(search_string,count,1) <> chr(45))) then search = search & mid(search_st,count,1) count = count + 1 else search = search & chr(37) count = count + 1 end if loop search_words = split(search," ") count = 0 do while count <= ubound(search_words) search_words(count) = "%" & search_words(count)& "%" count = count + 1 loop searchQuery = "select i.item_id " & _ "from formats f,categories ca,details d,subcategories s,companies co,items i " & _ "where co.company_id = i.company " & _ " and s.subcategory_id = i.subcategory " & _ " and d.line_id = i.line_id " & _ " and ca.category_id = i.category " & _ " and f.format_id = i.format " count = 0 do while count <= ubound(search_words) searchQuery = searchQuery & _ " and concat_ws(' ',ca.category_name,co.company_name,s.subcategory_name,d.line_name,f.format_name,i.item_name) " & _ " like '" & search_words(count) & "'" count = count + 1 loop searchQuery = searchQuery & " order by co.company_name, i.item_name" myDSN ="DSN=qw_com;uid=shmulik;pwd=gyunk4JQ" set connitems=server.createobject("adodb.connection") connitems.open myDSN set results = connitems.execute(searchQuery) end if %> Search Cambridge Camera HomeContact usView your shopping cartHelp























 
Search Cambridge Camera
   
<% if search_string <> "" then if not results.eof then %> <% count = 0 %> <% do while not results.eof %> <% sqlitem = "select items.item_id, items.item_name, items.price, items.static_url, companies.company_name from items inner join companies on items.company = companies.company_id where items.item_id = " & results(0) set item = connitems.execute(sqlitem) %> <% results.movenext count = count + 1 %> <% loop %>
<% if (item(3) <> "") then %> <% end if %> <% response.write(item(4) & " " & item(1))%> <% if (item(2) <> 0) then%><% response.write(formatcurrency(item(2)))%><% else %><%response.write("Call") %><% end if %>
 

Search Again

<% else %>

Sorry your search produced no results, please search
again or call us, we might have the item(s) you are looking for.

<% End If %> <% End If %>