views:

10

answers:

1

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.

A: 

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