If we have something like this, this will work, and we will not get any errors here:
I'm using something like this, and I'm able to insert data into the database.
If I do, however:
$stmt = $this->_dbh->prepare("INSERT INTO ourTable (ourColumn) VALUES (?)");
$stmt->bindParam(1, $someVo->getColumn(), PDO::PARAM_STR, 255);
I do get:
$stmt = $this->_dbh->prepare("SELECT d.ourColumn FROM ourTable d WHERE d.ourColumn LIKE ?");
$stmt->bindParam(1, '%' . $someVo->getColumn() . '%', PDO::PARAM_STR, 255);
- pointing to my bindParam line above.
Fatal error: Cannot pass parameter 2 by reference
I don't understand what this error means. Neither what pass something by reference really means... can I have some lights here?
I've read here and there that this may be related to the fact that we CANNOT pass values with bindParam but, that's what I do on the case A with success.
Thanks in advance, again and again,