Hi, I have a hopefully simple problem that perhaps someone could help me with. I am running Kuroi's stock by attributes mod and I want a query to select the stock levels for all attributes of a particular product ID.
So the query I have is for a sample product_id "8" is:
SELECT products_id, stock_attributes, quantity FROM products_with_attributes_stock
WHERE (products_id = 8)
ORDER BY stock_attributes ASC
Which works fine in phpMyAdmin fine and returns
9 rows for the 9 attributes I currently have, so far so good.
However when I put this into php as follows:
$stock_for_this_prod = "SELECT products_id, stock_attributes, quantity FROM products_with_attributes_stock WHERE products_id = $products_id_current ORDER BY stock_attributes ASC";
$stock_for_this_prod= $db->Execute($stock_for_this_prod);
$stock_for_this_prod only ever contains details for the first row / attribute.
print_r($stock_for_this_prod); gives:
queryFactoryResult Object ( [is_cached] => [resource] => Resource id #574 [cursor] => 0 [EOF] => [fields] => Array ( [products_id] => 8 [stock_attributes] => 179 [quantity] => 6 ) )
i.e. only the row for attribute number 179.
How can I get the rest of the rows to be returned with the $db->Execute funtion?
Thanks.
Bookmarks