javascript - populate multiple select from mysql database prestashop -


i want create multiple select add/remove button , values in multiple select want fetch mysql query. question how populate result of query in select lists value? code follows: product.tpl

         <form>          <fieldset>          <form name="formname1">          <select name="selectfrom" id="select-from" multiple size="5" >          <option value="1?>">item1</option>          <option value="2">item 2</option>          <option value="3">item 3</option>          <option value="4">item 4</option>          </select>           <a href="javascript:void(0);" id="btn-add">add &raquo;</a>          <a href="javascript:void(0);" id="btn-remove">&laquo; remove</a>           <select name="selectto" id="select-to" multiple size="5">          <option value="5">item 5</option>          <option value="6">item 6</option>          <option value="7">item 7</option>          </select>          <input type="button" onclick="myfunction()" value="submit form">          </fieldset>          </form> 

and php file code :

       public function products_configure($url){        $productsel = "select id_product,name ". _db_prefix_ ."product_lang";           $products = db::getinstance()->executes($productsel);               foreach($products $product){                 $productintid = $product['id_product'];                 $productintname = $product['name'];                    }                   $this->context->smarty->assign(array(                   'url' => $url                    ));               return $this->fetchtemplate('/views/templates/back/products.tpl');                }  

can pls tell how use $productintname option value in tpl file.


Comments