dear all
I implemented the search code as suggested by user 'benblee' on your forum. However, when I search for a part of a field (eg search for 'pierro' in the name field 'del pierro'), no results show up. Is there a solution for this?
Thanks and all the best
I implemented the search code as suggested by user 'benblee' on your forum. However, when I search for a part of a field (eg search for 'pierro' in the name field 'del pierro'), no results show up. Is there a solution for this?
Thanks and all the best
Hi vandereyde,
You don't say what code you are using but you probably want something like
Bob
You don't say what code you are using but you probably want something like
echo "WHERE `field_name` LIKE '%{value}%'";Bob
Code I use:
Changed
THANKS very much
<?php
$search_array = array('client', 'serial', 'vehicle');
$where = array();
foreach ( $search_array as $search ) {
$value = JRequest::getVar($search, '' , 'post');
if ( $value ) {
$where[] = " $search LIKE '$value%' ";
}
}
if ( !empty($where) ) {
echo " WHERE ".implode(' AND ', $where);
}?>Changed
$value% into %$value% and it works nowTHANKS very much
This topic is locked and no more replies can be posted.
