Skip to content

Simple WHERE doesn't seem to work correctly in 3.0.0 #209

@donatj

Description

@donatj

I have the following code that worked fine in 2.x but does not seem to work at in 3.x because it is missing a bind value.

While I could be doing something wrong, I suspect this is a problem with the library as this seems like a simple query that isn't far from the documented examples.

$select = $this->mysqlQueryFactory->newSelect()
	->cols([ '*' ])
	->from('users')
	->where("user_id = ?", [ 10 ])
	->where("deleted = ?", [ 0 ]);

var_export($select->getStatement());
echo "\n\n";
var_export($select->getBindValues());

In 2.8.1 it generates

'SELECT
    *
FROM
    `users`
WHERE
    user_id = :_1_
    AND deleted = :_2_'

with the following bind values

array (
  '_1_' => 10,
  '_2_' => 0,
)

In 3.0.0 it generates

'SELECT
    *
FROM
    `users`
WHERE
    user_id = ?
    AND deleted = ?'

with this single bind value

array (
  0 => 0,
)

It seems like something is happening and my first bind value is getting lost.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions