Witam
czy jest sposob aby posortowac tablice najpier po konkretnym id a nastepnie np po nazwie ?
czyli na gore trafia jeden konkretny rekord, reszta po nazwie ?
SELECT * FROM tabela WHERE /*** Ograniczenie **/ ORDER BY id LIMIT 1 UNION SELECT * FROM tabela WHERE ( /*** Ograniczenie **/ ) AND id!=( SELECT * FROM tabela WHERE /*** Ograniczenie **/ ORDER BY id LIMIT 1) ORDER BY name
<?php $categories_query = tep_db_query("select c.categories_id,c.art_producent , c.art , c.categories_status, cd.categories_name, cd.categories_htc_keywords_tag, c.paren
t_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.categories_id = 102 UNION select c.categories_id,c.art_producent , c.art , c.categories_status, cd.categories_name, cd.categories_htc_keywords_tag, c.paren
t_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = " . (int)$value . " and c.categories_status>0 and c.categories_id = cd.categories_id and cd.language_id='" . (int)$languages_id ."' order by c.sort_order, cd.categories_name"); ?>