Skip to content

Variable argument queries for question mark parameters

Pre-release
Pre-release

Choose a tag to compare

@g105b g105b released this 05 Feb 18:18

Certain queries are better to use ? placeholders rather than :named placeholders, typically queries where the placeholder can be inferred by the query name.

For example, the getById query should only take the one parameter, which doesn't need to be named "id" when calling.

Clean, improved syntax:

$customer = $db["customer"]->getById(123);

Rather than:

$customer = $db["customer"]->getById(["id" => 123]);