Doctrine\DBAL\Query\QueryBuilder::createPositionalParameter
Create a new positional parameter and bind the given value to it.
Attention: If you are using positional parameters with the query builder you have to be very careful to bind all parameters in the order they appear in the SQL statement , otherwise they get bound in the wrong order which can lead to serious bugs in your code. Example: <code> $qb = $conn->createQueryBuilder(); $qb->select('u.*') ->from('users', 'u') ->where('u.username = ' . $qb->createPositionalParameter('Foo', PDO::PARAM_STR)) ->orWhere('u.username = ' . $qb->createPositionalParameter('Bar', PDO::PARAM_STR)) </code>
Signature
public function createPositionalParameter(mixed
$value,
[mixed
$type = PDO::PARAM_STR] )
Parameters
$value
— mixed$type
— mixed
Returns
- string