Re: [PHP] Super SQL problem! Please advise!

2001-02-09 Thread Sandeep Hundal
Thanks a lot for your help everyone!!! It worked!! Woohoo!! Not only that, I learned about joins! :) /sunny --- Steve Werby <[EMAIL PROTECTED]> wrote: > "Sandeep Hundal" <[EMAIL PROTECTED]> wrote: > > thanks for the tip steve. i read up on left joins, and got this: > > SELECT diary.id, diary.the

Re: [PHP] Super SQL problem! Please advise!

2001-02-08 Thread Graham Reeves
rica - Q Data Consulting www.pqafrica.co.za Tel No : +27 +43 +722 Cell No: 082 870 3205 - Original Message - From: Sandeep Hundal <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, February 08, 2001 6:11 AM Subject: [PHP] Super SQL problem! Please advise!

Re: [PHP] Super SQL problem! Please advise!

2001-02-08 Thread Steve Werby
"Sandeep Hundal" <[EMAIL PROTECTED]> wrote: > thanks for the tip steve. i read up on left joins, and got this: > SELECT diary.id, diary.thedate, diary.topic, diary.entry > FROM diary > LEFT JOIN comments > ON diary.id = comments.id; > > but it only joins the two tables. Right. It took care of yo

Re: [PHP] Super SQL problem! Please advise!

2001-02-08 Thread Sandeep Hundal
thanks for the tip steve. i read up on left joins, and got this: SELECT diary.id, diary.thedate, diary.topic, diary.entry FROM diary LEFT JOIN comments ON diary.id = comments.id; but it only joins the two tables. What I need is only 1 column from the second table, counted. Something like this,

Re: [PHP] Super SQL problem! Please advise!

2001-02-07 Thread Steve Werby
"Sandeep Hundal" <[EMAIL PROTECTED]> wrote: > SELECT diary.id, diary.thedate, diary.topic, diary.entry, > count(comments.id) AS comments FROM diary, comments WHERE > diary.month='$month' AND diary.id = comments.id GROUP BY comments.id > ORDER BY diary.id DESC " > > Basically what I've done is made

[PHP] Super SQL problem! Please advise!

2001-02-07 Thread Sandeep Hundal
Hey all, I got this massive query, which I hope you'll be able to understand: SELECT diary.id, diary.thedate, diary.topic, diary.entry, count(comments.id) AS comments FROM diary, comments WHERE diary.month='$month' AND diary.id = comments.id GROUP BY comments.id ORDER BY diary.id DESC " Basical