$qr_result = mysql_query("select * from " . $db_table_to_show. " where pAdmins > 1")
or die(mysql_error());
$resultArray = array();
foreach ($array as $element) {
$resultArray[$element['COUNTER-ID']] = $element;
}
echo $resultArray[14]['VALUE']; //VALUE последнего элемента, где COUNTER-ID = 14
echo $resultArray[15]['VALUE']; //VALUE последнего элемента, где COUNTER-ID = 15
SELECT
`plug_cat_sizes_join`.`item_id`,
`plug_cat_sizes_join`.`size_id`,
`plug_cat_colors_join`.`item_id`,
`plug_cat_colors_join`.`color_id`
FROM
`plug_cat_sizes_join`
JOIN `plug_cat_colors_join`
ON `plug_cat_colors_join`.`item_id` = `plug_cat_sizes_join`.`item_id`
JOIN `plug_cat_vals` as val
ON val.`write_id` = `plug_cat_colors_join`.`item_id`