[thesite] new styles for beo, leo, meo, and print

Daniel J. Cody djc at starkmedia.com
Mon Feb 26 19:47:52 CST 2001


rudy wrote:


> *never* willingly undertake to do the database's job (procedure)
> 
> always state the query in terms of which records you want (content)

oook.. *hangs head in shame*.. sorry was in a hurry.. its not looping anymore, just emailing
everyone X ammounts of times..

> what you just said up there sounded as ugly as  <font face=Arial><p><font
> face="Comic Sans MS"><b>loops the <i></b>recordset!!</font></i></font></p>

doh! but i *like* comic sans ms!! ;( heh

> yup, use the DISTINCT keyword in the query
> 
> let's do a quick analysis
> 
> first, process the add-a-comment form
> 
>   insert into replies values ( ... )
> 
> the userid for the author of the comment is the logged on user, right?  and
> the article id is in the url, right?
> 
> okay, assuming that gets done, let's recap what we know
> 
> we have the article id of the article, and we know there's at least one
> comment on it (the one that was just added), and the comment(s) are from at
> least one user (the one that just added the comment), and if there are any
> other comments on the article, they could be from any number of users,
> including the one that was just added, and any user can have multiple
> comments
> 
> yeah, use exactly what you have for the where clause --
> 
>          WHERE
>      users.userid = replies.userid
>        AND replies.contentid = 3509
>          AND users.userid != 5
> 
> just add DISTINCT to the select list
> 
> and don't you have to test the notify column to see if the email should go
> to each person?

ok rude.. i'll give this a whirl and get back to ya..

thanks brotha man.

.djc.
Chief Wuukie Weki Bad Record Sety





More information about the thesite mailing list