ok
Direktori : /home2/selectio/www/vijay-gases/apis/ |
Current File : /home2/selectio/www/vijay-gases/apis/get-particular-gas-api.php |
<?php ob_start(); session_start(); include "../config/config.php"; $session_id = $_SESSION['vijay_gases']['id']; if(isset($_POST['pids']) && $_POST['pids']!='' && $_POST['pids']!='all' && $_POST['pids']!='0'){ $string_version = implode(',', $_POST['pids']); $statement = $pdo->prepare("SELECT tbl_gas.gas_name,COUNT(tbl_gas.id) as gas_count FROM `tbl_product`INNER JOIN tbl_gas ON tbl_product.product_name=tbl_gas.id WHERE tbl_product.id in (".$string_version.") GROUP BY tbl_gas.gas_name"); $statement->execute(); $totals = $statement->rowCount(); $result = $statement->fetchAll(PDO::FETCH_ASSOC); $response=''; if($totals) { foreach($result as $gas_data){ $response=$response.'<span>Particular Gas . '.$gas_data['gas_name'].'</span>   <span> Count .'.$gas_data['gas_count'].'</span> '; // error_log($response); } } echo $response; } ?>