requete sql bug

requete sql bug - PHP - Programmation

Marsh Posté le 23-10-2002 à 22:47:18    

Code :
  1. select a.pseudo as pseudo_top ,a.last_poster as last_poster, a.sujet as sujet, a.id as id, a.max(page) as maxpage, b.pseudo as pseudo_rep, c.email as email from topics a, reponses b, membres_ob c where a.email_rep = '1' or b.email_rep = '1' and a.id = b.topic_id and (a.pseudo = c.pseudo or b.pseudo = c.pseudo)"


 
pk ce ki est en rouge fait bugge la rekete ?

Reply

Marsh Posté le 23-10-2002 à 22:47:18   

Reply

Marsh Posté le 23-10-2002 à 23:41:55    

--stan-- a écrit a écrit :

Code :
  1. select a.pseudo as pseudo_top ,a.last_poster as last_poster, a.sujet as sujet, a.id as id, a.max(page) as maxpage, b.pseudo as pseudo_rep, c.email as email from topics a, reponses b, membres_ob c where a.email_rep = '1' or b.email_rep = '1' and a.id = b.topic_id and (a.pseudo = c.pseudo or b.pseudo = c.pseudo)"


 
pk ce ki est en rouge fait bugge la rekete ?



tu peux faire un max un min ou autres opérations du genre, que si tout les autre champs retourné dans ta requête sont regroupé grace à un group by.
 
Dans ton cas, ca donne :
select a.pseudo as pseudo_top ,a.last_poster as last_poster, a.sujet as sujet, a.id as id, a.max(page) as maxpage, b.pseudo as pseudo_rep, c.email as email from topics a, reponses b, membres_ob c where a.email_rep = '1' or b.email_rep = '1' and a.id = b.topic_id and (a.pseudo = c.pseudo or b.pseudo = c.pseudo)
group by pseudo_top ,last_poster, sujet, id, pseudo_rep, email

Reply

Marsh Posté le 24-10-2002 à 09:07:36    

merci bcp ! :)  :jap:  :hello:

Reply

Sujets relatifs:

Leave a Replay

Make sure you enter the(*)required information where indicate.HTML code is not allowed