Pogledajte određenu poruku
Staro 06. 02. 2013.   #3
sinisake
član
Certified
 
Datum učlanjenja: 26.07.2008
Poruke: 76
Hvala: 15
284 "Hvala" u 10 poruka
sinisake is on a distinguished roadsinisake is on a distinguished roadsinisake is on a distinguished road
Default

Eh, stiglo resenje, cisto da neko ne gubi vreme:
Citat:
SELECT category_recipe.rec_id, category_recipe.cat_id, r.name, r.url, r.main_image, c.id, c.title
FROM (
(

SELECT category_recipe . *
FROM category_recipe
WHERE cat_id =10
ORDER BY rand( )
LIMIT 4
)
UNION ALL (

SELECT category_recipe . *
FROM category_recipe
WHERE cat_id =30
ORDER BY rand( )
LIMIT 4
)
UNION ALL (

SELECT category_recipe . *
FROM category_recipe
WHERE cat_id =64
ORDER BY rand( )
LIMIT 4
)
)category_recipe
JOIN categories c ON category_recipe.cat_id = c.id
JOIN recipes r ON category_recipe.rec_id = r.id
Prvim upitom vadim random id-ove kategorija, pa ih smestam u ovaj... E, sad, naravno, morao sam da odradim dodatni upit za 9 random recepata (thumbovi), sto je ukupno 3, samo za slideshow... Page caching 100% pada, druge nema, s obzirom na sve ovo...
sinisake je offline   Odgovorite uz citat