Skip to content

Instantly share code, notes, and snippets.

@jsmitka
Created February 18, 2010 20:15
Show Gist options
  • Save jsmitka/308008 to your computer and use it in GitHub Desktop.
Save jsmitka/308008 to your computer and use it in GitHub Desktop.
<?php
public function hledej($vyraz, $sloupec)
{
$conditions = array();
if ($sloupec == 'K') {
for ($i = 1; $i <= 4; ++$i)
$conditions[] = array('%n LIKE %s', $sloupec . $i, '%' . $vyraz . '%');
} else {
$conditions[] = array('%n LIKE %s', $sloupec, '%' . $vyraz . '%');
}
$this->vysledek = dibi::select('*')
->from($this->tabulka)
->where('%or', $conditions)
->limit('10')
->fetchAll();
return $this->vysledek;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment