добрый день!
есть 2 запроса: первый находит номера в определенной таблице, а второй из полученных данных ищет в остальных таблицах. сделал так
$result1 = mysql_query("
SELECT ART.ART_ID, ART.ART_ARTICLE_NR
FROM ARTICLES AS ART
WHERE ART.ART_ARTICLE_NR like '%".$f_1."%' AND ART.ART_ID like '%".$f_2."%'
");
$i = 0;
if (mysql_num_rows($result1) > 0) {
while($a = mysql_fetch_row($result1))
{
$i++;
$res = mysql_query("
SELECT
shop_items_catalog_item_id as item_id,
shop_items_catalog_marking,
shop_items_catalog_name,
shop_vendorcode,
round((
(SELECT shop_warehouse_items_count FROM shop_warehouse_items_table WHERE shop_warehouse_id = 3 AND shop_items_catalog_item_id = item_id) +
(SELECT shop_warehouse_items_count FROM shop_warehouse_items_table WHERE shop_warehouse_id = 4 AND shop_items_catalog_item_id = item_id) +
(SELECT shop_warehouse_items_count FROM shop_warehouse_items_table WHERE shop_warehouse_id = 5 AND shop_items_catalog_item_id = item_id)
),0),
round((SELECT shop_warehouse_items_count FROM shop_warehouse_items_table WHERE shop_warehouse_id = 4 AND shop_items_catalog_item_id = item_id),0),
round((SELECT shop_warehouse_items_count FROM shop_warehouse_items_table WHERE shop_warehouse_id = 3 AND shop_items_catalog_item_id = item_id),0),
round((SELECT shop_warehouse_items_count FROM shop_warehouse_items_table WHERE shop_warehouse_id = 5 AND shop_items_catalog_item_id = item_id),0),
(SELECT shop_prices_to_item_value FROM shop_prices_to_item_table WHERE shop_list_of_prices_id = 4 AND shop_items_catalog_item_id = item_id),
(SELECT shop_prices_to_item_value FROM shop_prices_to_item_table WHERE shop_list_of_prices_id = 5 AND shop_items_catalog_item_id = item_id)
FROM `shop_items_catalog_table`
WHERE
shop_vendorcode = '{$a[1]}' AND shop_items_catalog_marking = '{$a[0]}'
ORDER BY
shop_vendorcode
");
if (mysql_num_rows($res) > 0) {
while ($b = mysql_fetch_row($res)) {
if ($b[4] > 0) {
echo "<tr align='center' id='tr2_{$i}'>
<td id='tr_{$i}_1'>{$a[1]}</td>
<td id='tr_{$i}_2'>{$a[2]}</td>
<td id='tr_{$i}_3' align='left'>{$a[2]}</td>
<td id='tr_{$i}_4'><div id='hide_{$i}' style='display: none;'>{$a[8]}</div></td>
<td id='tr_{$i}_5'>{$a[9]}</td>
<td id='tr_{$i}_6'>{$a[4]}</td>
<td id='tr_{$i}_7'>{$a[5]}</td>
<td id='tr_{$i}_8'>{$a[6]}</td>
<td id='tr_{$i}_9'>{$a[7]}</td>
}
}
}
}
}
но он не выводит данные
не подскажите почему?