view page of multiple selected value and labels May 09, 2020, 10:22:11 AM Dear friends,I have stucked in one issue and cannot figure it out.I have two tables ascompanies and sitescompanies : id, name, etc.Sites: id, sitename, referencecompany(foreignkey), etc.one company may have multple sites.I use multi selection in add page(company) as value = id and label = sitename İssue is multi selected IDs ar written in sql as an example " 2,5,7"view page shows only IDs as text view. as "2,5,7"when I choose mater detail, I can see related view as modal (label of the value) but only one site not all the chosen seperatedly. is the any way to correct the issue or is it a some bug? Quote Selected
Re: view page of multiple selected value and labels Reply #1 – May 09, 2020, 06:53:55 PM @gokand this is not a bug, this was how to was built. In the future, there might be an update to resolve it, but now, you will have to write your PHP code to handle it for you. Quote Selected
Re: view page of multiple selected value and labels Reply #2 – May 09, 2020, 07:04:00 PM Quote from: willvin – May 09, 2020, 06:53:55 PM@gokand this is not a bug, this was how to was built. In the future, there might be an update to resolve it, but now, you will have to write your PHP code to handle it for you. Thank you for your support. Is ıt possible get the support of coding from you? maybe via patreon Quote Selected
Re: view page of multiple selected value and labels Reply #3 – May 10, 2020, 11:21:37 AM @gokand yes, it is possible. Quote Selected
Re: view page of multiple selected value and labels Reply #4 – May 19, 2020, 09:41:09 AM <?php//single row:$company_id=$cid;$cmtcc = new CompanyController;$db = $cmtcc->GetModel();//execute SQL statement and return a single row$params = array($company_id); $array = $db->rawQuery("SELECT * FROM company WHERE id = ?", $params); $company=$array['0'];?> <br <?php echo $company['company']; ?><br> <?php echo (ucwords($company['vat'])); ?>//etc....<? //many rows// one way in my case $products_in_cart is an array with a product_ids and quantitys$cmtc = new ProductController;$db = $cmtc->GetModel();$exeq = (array_keys($products_in_cart));$counter = 0; for($i=0; $i<count($exeq); $i++){ $pid = $exeq[$i]; $pid = array($pid); $pids = $db->rawQuery("SELECT * FROM product WHERE id = ?", $pid); $product = $pids['0']; $counter++;?> <br <?php echo $product['name'; ?> <br <?php echo $product['id'; ?><?}// the above code is simple but could crash, so it is better to call the db array first then the loop as:$params = array($products_in_cart);$arr = $db->rawQuery("SELECT * FROM product WHERE id IN (?)", $params );see also: https://phprad.com/forum/index.php?topic=834.0 especially wilvin links and video Quote Selected 2 Likes