[ic] $db-->query inner join

Gert van der Spoel gert at 3edge.com
Tue Mar 10 15:05:56 UTC 2009



> -----Original Message-----
> From: interchange-users-bounces at icdevgroup.org [mailto:interchange-
> users-bounces at icdevgroup.org] On Behalf Of Sam Batschelet
> Sent: Tuesday, March 10, 2009 5:07 PM
> To: interchange-users at icdevgroup.org
> Subject: [ic] $db-->query inner join
> 
> Been trying to do an inner join query with no luck from the docs this
> should
> be working but no go any ideas?
> 
> my $q = $db->query({
> 
> sql => 'SELECT sum(quantity) FROM inventory INNER JOIN variants WHERE
> inventory.sku = variants.code and variants.sku=$sku',
> 
> });

-  and variants.sku="$sku"   perhaps ... because sku I expect is not a
number, but a string
-  if your site is based on the demo, then I expect this to not be returning
too much as the variants.code in that case never matches an inventory.sku
unless you did it differently ...  in the demo the variant.sku and the
inventory.sku are the ones that are equal ...

CU,

Gert






More information about the interchange-users mailing list