3

I've using ADOdb Execute function:

$query = "select * from users where user_id = ? and PWD = ?";
$execute = $conn->Execute($query,array($username, $password));

Which gives the error:

Fatal error: Cannot pass parameter 2 by reference

I have no idea why. Any ideas?

Pacerier
  • 86,231
  • 106
  • 366
  • 634
lovefaithswing
  • 1,510
  • 1
  • 21
  • 37

1 Answers1

5

Most likely the Execute method is declared as public function Execute($query, &$params) meaning the second method is expected to be passed by reference. Thus you have to pass a variable. Try this:

$query = "select * from users where user_id = ? and PWD = ?";
$params = array($username, $password);
$execute = $conn->Execute($query, $params);
Martin Dimitrov
  • 4,796
  • 5
  • 46
  • 62