Santori Posted December 30, 2016 Share Posted December 30, 2016 (edited) Hello guys, I have a little issue with php: I need to retrieve the count of sql and show it at tpl but results are always 1, not the count results, Can you help me please? public function hook() { $sql = (int)Db::getInstance()->Execute ('SELECT COUNT(*) as A FROM ps_table WHERE validate = 1'); $this->context->smarty->assign(array( 'variable' => $sql,)); return $this->display(__FILE__, 'template.tpl'); } Then in template with {$variable} the results = 1, but not the count What Im doing wrong? Edited December 30, 2016 by Santori (see edit history) Link to comment Share on other sites More sharing options...
Santori Posted December 30, 2016 Author Share Posted December 30, 2016 SOLVED: getInstance()->getValue Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now