Hello every body.
I have a table that stores products with the following fields.
[b]id, product_name, product_amount, product_metric[/b]
[b](e.g. 1, 'Bread', 100, 1)[/b]
and another table that holds the metrics
[b]id, metric_title, metric_abr[/b]
[b](e.g. 1, 'Kilos', 'Kg')[/b]
and i want to show in the drop down that product name, along with the remaining amount and the metric.
[b]e.g. Bread - (100 Kg. Remaining).[/b]
I was using this code
[b]$crud->set_relation('product','products','{name} - ({ammount} {(SELECT metric_abr FROM metrics WHERE id = products.metric)} Remaining)',NULL,NULL);[/b]
which worked fine until i upgraded Grocery Crud today, to the latest version.
The strange think is that the query produced from the above code works fine in phpMyAdmin.
Any ideas?
Thanks in advance.
Select statement inside set_relation
Started by crazycondor, 04 December 2012 - 14:16 PM
- Single Page
Posted 04 December 2012 - 14:16 PM