I'm trying to extract data from column 'field_data' in table tk_custom_data WHERE:
- 'product_id' in table 'tk_custom_data' matches 'id' in other table called 'tk_product' and
- 'field_id' in table 'tk_custom_data' is equal to "21"
Result should be extracted when using $main_result
But this is simply too complicated for me, I'm still a total newbie. Please help :( Using IDIORM ORM
$product_id = ORM::for_table($config['db']['pre'].'product')->find_one($_GET['id']);
$item_id = $product_id['id'];
$value = '21';
$result = ORM::for_table($config['db']['pre'].'custom_data')
->where('product_id',$item_id)
->where('field_id',$value)
->find_one();
foreach ($result as $info) {
$main_result = $info['field_data'];
}