$v = str_replace('*','%',$v);
$v = $this->db()->quote($v);
- $equal = ' '.($not ? 'NOT ' : '').'LIKE ';
+ if (preg_match('/[_%]/',$v)) {
+ $equal = ' '.($not ? 'NOT ' : '').'LIKE ';
+ } else {
+ $equal = ($not ? '<> ' : '=');
+ }
// Others
} else {
# having, denorm, EMPTY
$extra_where = (string)$this->db()->type('extra_where');
if ($extra_where == 'having' and $field->extra) {
- $having[] = "$k$equal$v";
+ $having[] = $this->extras[$k]->sql_name()."$equal$v";
} elseif ($extra_where == 'denorm' and $field->extra) {
$where[] = $this->extras[$k]->sql_name()."$equal$v";
+ } elseif ($field->extra) {
+ $where[] = $this->extras[$k]->sql_name()."$equal$v";
} else {
- $where[] = "$k$equal$v";
+ $where[] = $field->sql_name()."$equal$v";
}
} #foreach fields
if ($out_conf) {
out::end($out_conf);
+
} else {
echo $this->{"rows_end_$format"}();