i trying join 3 tables , store result. problem cannot seem deal it. hours of googling , searching led nothing.
here query:
$db = jfactory::getdbo(); $item_kit = array(); $q = "select p.virtuemart_product_id, pr.product_price, pr.virtuemard_product_id, pb.group_id #_virtuemart_products p inner join #_virtuemart_product_prices pr on p.virtuemart_product_id = pr.virtuemart_product_id, inner join #_pb_group_vm_prod_xref pb on pb.vm_product_id = pr.virtuemart_product_id"; $db->setquery($q); $item_kit = $db->loadobjectlist(); return $item_kit; please notice using id common element in tables. after nonsense occurs should like:
if(!empty($item_kit['group_id'])){ echo 'it works'; } debugging resulted in discovering sql error near 'inner join #_virtuemart_product_prices pr on p.virtuemart_product_id = pr.virtu...'
can please me? or, @ least, point out doing stupidly wrong... know it's small , easy, can't see it...
thank in advance, vlad
found problem! pr.virtuemard_product_id pr.virtuemart_product_id , had manually type in database table prefix. silly of me. thank time reading question. regards, vlad
Comments
Post a Comment