A voir également:
- Fusioner 3 requete select avec même clause et limit
- Ai suite 3 - Télécharger - Optimisation
- Picasa 3 - Télécharger - Albums photo
- 552 size limit exceeded ✓ - Forum Réseaux sociaux
- Photorecit 3 - Télécharger - Visionnage & Diaporama
- Please select boot device ✓ - Forum Windows
1 réponse
Bonjour,
Avec du JOIN pour les USERS
et un UNION pour lier deux requêtes ...
Voila la requête:
Avec du JOIN pour les USERS
et un UNION pour lier deux requêtes ...
Voila la requête:
SELECT 'ARTICLE' as TYPE , articles_name as NAME , articles_text as TEXT , articles_note as NOTE FROM articles A LEFT JOIN users U ON U.id = A.articles_user_id WHERE articles_user_id = '$id' ORDER BY articles_date DESC LIMIT 5 UNION SELECT 'COMMENTAIRE' as TYPE , '' as NAME , comments_text as TEXT , '' as NOTE FROM comments C LEFT JOIN users U ON U.id = C.comments_user_id WHERE comments_user_id = '$id' ORDER BY comments_date DESC LIMIT 10