I'm getting an error when I use the PDP bindParam , code:
ConnectionPDO Class:
function __construct($dsn, $username = NULL, $password = NULL, $options = NULL) {
parent::__construct($dsn, $username, $password, $options);
$this->LoadDriverMethods();
}
public function insert($table, $data) {
$this->lastSQL = $this->driver->insert($table, $data);
$stmt = $this->prepare($this->lastSQL);
$this->driver->setParams($this->stmt);
return $this->stmt;
}
private function LoadDriverMethods(){
$driver = __DIR__ . DIRECTORY_SEPARATOR . 'drivers' .
DIRECTORY_SEPARATOR . 'sqldriver.' .
strtolower($this->getAttribute(PDO::ATTR_DRIVER_NAME)) . '.php';
if (!is_file($driver))
throw new Exception('Não foi possível carregar os métodos do driver', 1);
require_once $driver;
$this->driver = new SQLDriver();
}
SQLDriver class:
public function setParams(PDOStatement $stmt){
$params = $this->getParams();
if (is_array($params) && !empty($params))
foreach ($params as $param => $value)
$stmt->bindParam($param, $this->prepareParam($value), $this->getParamType($value));
}
Error:
Strict Standards: Only variables should be passed by reference in \ ConnectionPDO \ drivers \ sqldriver.mysql.php
The following line in the SQLDriver class refers to:
$stmt->bindParam($param, $this->prepareParam($value), $this->getParamType($value));