
03-29-2007, 06:24 PM
|
 |
|
|
Join Date: Jun 2002
Location: Texas
Posts: 669
Благодарил(а): 0 раз(а)
Поблагодарили:
0 раз(а) в 0 сообщениях
|
|
As Paul M indicated, it's hard to tell you why it's doing an unspecified undesired behavior. Just looking at the code alone, though: - You're making a list of threadids and firstpostids, except that you didn't select firstpostids, so you're making a list of threaids and NULLs, which is probably giving you trouble in the second query. Remove the line adding firstpostids to the list; you're using the list as threadids anyway.
- Your second query GROUPs BY a post field, but you're joining with the post table on the primary key, so there will never be duplicates; the GROUP BY clause is unneeded and may be causing problems
- You're joining with the parsed post table, but not using it. This is a waste of mysql time.
- You limit your results in both queries, which is sure to cause problems when you later increase the first limit and can't figure out why it didn't work.
- Your current design cuts off a post in the middle of any tags that may be open, leaving them open for the rest of the page
- When you do the template, you set the string equal to it, instead of concatenating, which means only the last result will be in your string when you're done
|