Skip to content

Instantly share code, notes, and snippets.

@myfinder
Created December 7, 2009 11:42
Show Gist options
  • Save myfinder/250782 to your computer and use it in GitHub Desktop.
Save myfinder/250782 to your computer and use it in GitHub Desktop.
152 # product_idに対応する商品情報を取得
153 my $sth_item = $dbh_slave->prepare(<<"SQL");
154 select
155 d.picture_name,
156 i.item_color,
157 i.item_size
158 from
159 m_product p,
160 m_item i,
161 item_image_data d
162 where
163 p.product_id = ?
164 and
165 p.product_id = i.product_id
166 and
167 i.item_id = d.item_id
168 and
169 i.sales_status = 1
170 group by
171 i.item_color
172 SQL
173
174 $sth_item->execute($product_id);
175
176 $product->{items} = $sth_item->fetchall_arrayref(+{});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment