We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
function fetch($db, $translator, $wheres) { $query = new \ClanCats\Hydrahon\Query\Sql\Select; /* other stuff to setup query */ $query->where($wheres); list($queryString, $queryParams) = $translator->translate($query); return getQueryResult($db, $queryString, $queryParams); } fetch($mysqli, $translator, [ 'otherThing' => 'otherValue', 'status' => [ 'Active', 'Inactive' ] ]);
The above code generates a MySQL error: "Operand should contain 1 column(s)"
Examining the generated query string:
select fields from table where ( `otherThing` = ?, `status` = (?, ?) )
The Fix:
Replace \ClanCats\Hydrahon\Query\Sql\SelectBase.php:153-156:
\ClanCats\Hydrahon\Query\Sql\SelectBase.php:153-156
if (is_array($param2)) { $param2 = array_unique($param2); }
With:
if (is_array($param2)) { $param2 = array_unique($param2); if ($param1 === '=') $param1 = 'IN'; }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
The above code generates a MySQL error: "Operand should contain 1 column(s)"
Examining the generated query string:
The Fix:
Replace
\ClanCats\Hydrahon\Query\Sql\SelectBase.php:153-156
:With:
The text was updated successfully, but these errors were encountered: