I couldn't figure out what the value parameter is used for. So I thought, why not use it for something I need. Maybe someone needs that too. Maybe I use the software all wrong...
The current behaviour is this:
$q = $this->qb->select()->setTable("someTable")->where()->equals("id", 12345)->end();
$s = $this->qb->write($q);
// $s looks like this: SELECT someTable.* from someTable WHERE id = :v1
$s = parent::prepare($s);
// Context: the surrounding class extends PDO
$s->bindValue(":id", $id);
$s->execute();
$r = $s->fetch();
New behaviour:
$q = $this->qb->select()->setTable("someTable")->where()->equals("id", "myID")->end();
$s = $this->qb->write($q);
// $s looks like this: SELECT someTable.* from someTable WHERE id = :myID
$s = parent::prepare($s);
// Context: the surrounding class extends PDO
$s->bindValue(":myID", $id);
$s->execute();
$r = $s->fetch();
Note how the placeholder changed from the generic :v1 to a useable (even if the query was generated dymically) :myID - if (for whatever reason) myID was used twice, the placeholder changes to :myID1 and so on.
Hy,
I couldn't figure out what the value parameter is used for. So I thought, why not use it for something I need. Maybe someone needs that too. Maybe I use the software all wrong...
The current behaviour is this:
New behaviour:
Note how the placeholder changed from the generic :v1 to a useable (even if the query was generated dymically) :myID - if (for whatever reason) myID was used twice, the placeholder changes to :myID1 and so on.