On Aug 21, 2007, at 8:37 PM, Eric Dannewitz wrote:

I'm racking my brain looking at the Mysql database, and trying to figure 
out how Comments are associated with stories.

Like, if I did a

select stories.sid,stories.stoid, count(comments.uid) nocomments from 
stories, comments where stories.stoid=comments.sid group by 2 order by 3;

It doesn't come out right. Ideas?

I believe the foreign key logic would be

stories.sid <-> comments.sid

My slashcode stuff: http://slash.lottadot.com
Slashcode faq: http://slash.lottadot.com/slash-faq
How to ask a question: http://www.catb.org/~esr/faqs/smart-questions.html#before