Hi,
how can we use multiple customize query, E.g there is default query
$g->select_command = "select * from table;
there is dropdown menu on the page which has options to count the records like, toyota,honda,ford, etc…
when user select an option (honda) we run the qurey as
select COUNT(*) from cars where model = 'honda';
now grid show all records related to model(honda) and count of records. how can we use customize query while default query is still there. Thanks.
You can use GET form method, and use $_GET data condition in select_command. e.g.
if ($_GET["brand")
$g->select_command = "select * from table WHERE brand = {$_GET['brand']}";
else
$g->select_command = "select * from table";
Abu Ghufran,
i have used it but there is no record. if i statically assign value to variable like below.
$dat = "honda";
$g->select_command ="SELECT * FROM tablename where model = '$dat'";
there is long error dialog box which contain my raw table data. data is not showing in grid.