Hi,
I'm trying to write a front end for a perl script a client of mine wrote. He wants me to get a list of messages from his database and then print a list of them. The list must be ordered by date (which I can do) and then grouped by topic (not sure if this is the right word to use, but I can't think of any other). Basically he wants me to have the parent thread at the top and each reply under it. I am having problems doing this. Right now this is the statement i'm using.
$sql_query_byDate = "SELECT subjfield, fromfield, datefield FROM `$db_TABLE` WHERE 1=1 GROUP BY `in_repl_tofield` ORDER BY `datefield`";
Now, it's grouping my messages by reply to field, which is half of the way there, but I need it to group the parent field with it. The parent column is called msg_idfield.
Thanks! I hope I explained everything well enough.
I'm trying to write a front end for a perl script a client of mine wrote. He wants me to get a list of messages from his database and then print a list of them. The list must be ordered by date (which I can do) and then grouped by topic (not sure if this is the right word to use, but I can't think of any other). Basically he wants me to have the parent thread at the top and each reply under it. I am having problems doing this. Right now this is the statement i'm using.
$sql_query_byDate = "SELECT subjfield, fromfield, datefield FROM `$db_TABLE` WHERE 1=1 GROUP BY `in_repl_tofield` ORDER BY `datefield`";
Now, it's grouping my messages by reply to field, which is half of the way there, but I need it to group the parent field with it. The parent column is called msg_idfield.
Thanks! I hope I explained everything well enough.