View Single Post
Old 08-06-2004, 05:51 AM   #3 (permalink)
sailor
beauty in the breakdown
 
Location: Chapel Hill, NC
Id also create two tables. In the posts table, make sure you give each post a unique ID number. Then, for the comments table, have a column that you put the corresponding post ID in. Then you can sort and select by post ID (SELECT * FROM comments WHERE post_id = 'x') and go from there. PHP has a function, mysql_num_rows() (at least I think thats what its called) that will return the number of rows returned by a query that would be useful for getting the number of comments that correspond to each post.
__________________
"Good people do not need laws to tell them to act responsibly, while bad people will find a way around the laws."
--Plato
sailor is offline  
 

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43