[ic] Actionmap 2 table problem

IC ic at tvcables.co.uk
Wed Jun 27 13:45:53 UTC 2012


> Just to be clear, if you really want to go the IC search route do it
> like this:
> 
> $CGI->{mv_todo} = 'search';
> $CGI->{mv_nextpage} = $Config->{SpecialPage}->{results};
> $CGI->{mv_searchtype} = 'db';
> $CGI->{mv_coordinate} = 'yes';
> $CGI->{mv_substring_match} = 'yes';
> $CGI->{mv_search_page} = 'results';
> 
> $CGI->{mv_search_file} = 'products,products2';
> $CGI->{mv_search_field} = 'description';
> $CGI->{mv_searchspec} = $w1;
> $CGI->{mv_column_op} = 'rm';
> 
> $CGI->{mv_matchlimit} = '15';
> $CGI->{mv_sort_field} = 'sale_price';
> $CGI->{mv_sort_option} = 'n';
> 
> ...and make sure that HIDE_FIELD is set properly in your database config
> files:
> http://interchange.rtfm.info/icdocs/Database_reference_guide.html#HIDE_FIE
> LD

Thanks for the replies, which is more efficient in terms of server loading,
doing it with the search/action map or with sql.

I presume if I go for sql I just pass the mv_searchspec to the results page
and run the query there?

Something like:-

[query sql='
select sku, description, thumb, sale_price from products 
where (description like '%[value-extended name="mv_searchspec" index="1"
ascii="1"]%' AND inactive != 1 )
UNION ALL
select sku, description, thumb, sale_price from products2 
where (description like '%[value-extended name="mv_searchspec" index="1"
ascii="1"]%' AND inactive != 1 )
ORDER BY CAST(sale_price AS SIGNED) ASC'
type=list
]

[list]
....
[/list]
[/query]

Andy




More information about the interchange-users mailing list