Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scanner: Unknown opcode 58 #10821

Closed
tarikogut opened this issue Aug 24, 2015 · 4 comments
Closed

Scanner: Unknown opcode 58 #10821

tarikogut opened this issue Aug 24, 2015 · 4 comments
Labels
need script to reproduce Script is required to reproduce the issue

Comments

@tarikogut
Copy link

what is this ?

@andresgutierrez andresgutierrez added the need script to reproduce Script is required to reproduce the issue label Aug 24, 2015
@andresgutierrez
Copy link
Contributor

@andresgutierrez
Copy link
Contributor

@tarikogut ping

@tarikogut
Copy link
Author

tarikogut commented Sep 18, 2015

old code

$phql = 'SELECT total_credits - (SELECT SUM(remaining_credits) FROM
Frontend\Models\Sites WHERE users_id = :id) FROM Frontend\Models\Users
WHERE id = :id';

$available_credits = $this->modelManager->executeQuery($phql, array(
    'id' => $this->user->id
));

new code

$phql = 'SELECT total_credits - (SELECT SUM(remaining_credits) FROM
Frontend\Models\Sites WHERE users_id = :id:) FROM
Frontend\Models\Users WHERE id = :id:';
$available_credits = $this->modelManager->executeQuery($phql, array(
    'id' => $this->user->id
));

chang :id to :id:.

2015-09-18 11:23 GMT+03:00 Nguyen Tien Manh notifications@github.com:

I also encountered this error. This is code in a action

$phql = 'SELECT total_credits - (SELECT SUM(remaining_credits) FROM Frontend\Models\Sites WHERE users_id = :id) FROM Frontend\Models\Users WHERE id = :id';$available_credits = $this->modelManager->executeQuery($phql, array( 'id' => $this->user->id));

And, this is trace

Scanner: Unknown opcode 58

#0 [internal function]: Phalcon\Mvc\Model\Query->parse()
#1 https://github.com/phalcon/cphalcon/issues/1 [internal function]:
Phalcon\Mvc\Model\Query->execute()
#2 https://github.com/phalcon/cphalcon/issues/2 /srv/
shareview.libtools.org/apps/frontend/controllers/SitesController.php(128):
Phalcon\Mvc\Model\Manager->executeQuery('SELECT total_cr...', Array)
#3 https://github.com/phalcon/cphalcon/issues/3 [internal function]:
Frontend\Controllers\SitesController->distributionAction()
#4 https://github.com/phalcon/cphalcon/issues/4 [internal function]:
Phalcon\Dispatcher->dispatch()
#5 https://github.com/phalcon/cphalcon/issues/5 /srv/
shareview.libtools.org/public/index.php(186):
Phalcon\Mvc\Application->handle()
#6 https://github.com/phalcon/cphalcon/issues/6 {main}


Reply to this email directly or view it on GitHub
#10821 (comment).

@strayobject
Copy link

In case someone comes here with the same error, when you are naming your params you need TWO colons not one.
Good: WHERE id = :id:
Bad: WHERE id = :id

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
need script to reproduce Script is required to reproduce the issue
Projects
None yet
Development

No branches or pull requests

3 participants