Skip to content

setParameter issue when mixing :name and ?0 syntax #6699

@Seb33300

Description

@Seb33300

Example:

$queryBuilder

    ->andWhere("alias.field = :paramname")
    ->setParameter('paramname', $paramval)

    ->andWhere("alias.field = ?0")
    ->setParameter(0, $paramval)

;

If I call getParameters(), only 1 param is returned.

When executing the query, an exception is thrown:

Too few parameters: the query defines 2 parameters but you only bound 1

This seems to happen only if the param is named ?0.
With ?1, it seems to be ok.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions