I think I have a serious problem.
As I am migrating from MySQL to multiple banks, the old system there was
the following statement which had a seat speaker array and an array of
search terms.
He wore REGEXP to search all the columns the values of research.
Will can do something equivalent with DBAL?
in fact need to know how can I do a sort of "like in" with doctrine.
$columns = ['name', 'surname', 'age'];
$search = ['pablo', 'maria'];
the method below shows how I was doing with pure sql, this method just
returns me part of the string sql.
private function sqlBuscaGeral ($ filtroDinamico)
{
$buscaGral = \ filter_input (\INPUT_GET, 'sisBuscaGeral');
if ($buscaGral) {
$sql = 'AND (';
$fields = \str_replace (',', '|', $buscaGral);
$total = \ count ($ filtroDinamico);
$count = 0;
foreach ($filtroDinamico the $column => $aliasSql) {
$cont ++;
$alias = $aliasSql ? $aliasSql. '.' : '';
$sql. = $alias. $column. "REGEXP '." $fields. "'";
$sql. = $total == $cont ? '', 'OR';
}
$sql = ').';
}
return $sql;
}
--
You received this message because you are subscribed to the Google Groups
"doctrine-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/doctrine-user.
For more options, visit https://groups.google.com/d/optout.