Skip to content
New issue

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

Sparrow is not quoting the queries automatically. #38

Open
allanld29 opened this issue Apr 4, 2024 · 0 comments
Open

Sparrow is not quoting the queries automatically. #38

allanld29 opened this issue Apr 4, 2024 · 0 comments

Comments

@allanld29
Copy link

Sparrow is not quoting the queries automatically.

When i execute this code:
$db->from($table)->where($where)->select()->many();

with these parameters:

$table = 'produtos';

$where = [
  'codigo' => 99,
];

it gives me this SQL:
SELECT * FROM produtos WHERE codigo=99

and it returns me this:

Array
(
    [0] => Array
        (
            [id] => 478
            [codigo] => 99KIT03
            [saldo] => 3
            [descricao] => Kit 03 - Carregador
        )

    [1] => Array
        (
            [id] => 477
            [codigo] => 99
            [saldo] => 1
            [descricao] => Carregador
        )

)

Now, when i execute this: (with the same parameters)
$db->from($table)->where($where)->select()->one();

it returns me the wrong result, it returns the item with "codigo" "99KIT03", not the "99", because the values of the query are not quoted.
git

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant