arkanimus Posted November 26, 2013 Posted November 26, 2013 (edited) how can i save the value of a query into a variable...?? example.. $sql = select name from products where id_product = '33'; $name = (HERE I NEED SAVE THE NAME) help me please! Edited November 26, 2013 by vekia (see edit history) Share this post Link to post Share on other sites More sharing options...
Krystian Podemski Posted November 26, 2013 Posted November 26, 2013 See classes/Db.php - getValue method. Share this post Link to post Share on other sites More sharing options...
arkanimus Posted November 26, 2013 Posted November 26, 2013 Solved: in the controller: $id_cart = $this->context->cart->id; //SE CONSULTA EN LA BD LA CANTIDAD DE CAJAS $sql = 'SELECT cantcajas FROM `'._DB_PREFIX_.'cart` where `id_cart` = '.$id_cart.' '; // LA CANTIDAD SE ASIGNA A $CANTIDAD $cantidad = Db::getInstance()->getValue($sql); Share this post Link to post Share on other sites More sharing options...
vekia Posted November 26, 2013 Posted November 26, 2013 hello thank you for confirmation that you solved it and for your full solution, it will be really helpful for other merchants here thread marked as [solved] with regards, Milos Share this post Link to post 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