0

I was looking for something that is related to a mysql query and I stumbled to this link mysql variable usage and saw the stored proc-like variable setting. I've tried it in phpmyadmin :

SET @value = 5; SELECT @rank;

and it is working, but when I tried to place it in PDO statements, it does not work.

    $value = "SET @value = 0";
    $stmt = $this->_dbHandle->prepare($value);
    $stmt->execute();

Kindly guide on what I am doing wrong.

Community
  • 1
  • 1
Hanseh
  • 717
  • 4
  • 17

1 Answers1

0

Found the answer, my test environment is using sqlite. I've run my query in a test browser rather than in a phpunit test fixture and it did work.sorry guys, miss leaded by the test environment.

Hanseh
  • 717
  • 4
  • 17