Before displaying a page with my table on it I have the user make a selection from a drop down and then submit this via the post method.
I want to use the value of the post to filter my table.
I'm using the code below but the result is an empty table.
- Code: Select all
$this->Editor->setConfig('viewQuery',true);
$query = $_POST['id2'];
$this->Editor->setConfig('sqlFilters', "id = '".$query."'");
Below is the viewQuery output
- Code: Select all
select `purchase`.`ponumber`,
`purchase`.`id`,
concat(suppliers_0d594_0.sup_name) as `sup_id`,
concat(customers_54543_1.cust_name) as `cust_id`,
concat(cc.cat) as `cc_id`,
cc.markup as `markup`,
`purchase`.`DOP`,
`purchase`.`chargeable`,
`purchase`.`DESCR`,
`purchase`.`COG`,
`purchase`.`SRN`,
`purchase`.`charged`
from purchase
left join `suppliers` as `suppliers_0d594_0` on `purchase`.`sup_id` = `suppliers_0d594_0`.`sup_id`
left join `customers` as `customers_54543_1` on `purchase`.`cust_id` = `customers_54543_1`.`cust_id`
left join `cost_code` as `cc` on `purchase`.`cc_id` = `cc`.`cc_id`
where id = ''
order by `ponumber` desc limit 0, 20
I know the value is definitely posted because when I echo $query, a value is displayed.
Can anyone tell me where I'm going wrong?
Thanks,
Grant