I have written a forum and am using the following query to search in it:
$query="select topics.tid,f_messages.messid from f_messages left join
topics on f_messages.tid = topics.tid where ($title_list) OR ($msg_list)";
I trimmed it a bit to save space here (the last two are just strings).
It works fine, but it's returning more than once the same topics.tid
I want it to return only unique topic id's.
distinct doesn't work. I think it has to do with the f_messages.tid =
topics.tid as it isn't using distinct there.
I tried returning distinct(f_messages.tid) instead but again, no help!
This is using mysql. Re-structuring the db isn't an option.
Thanks for any light on this one, I can only think of dumping the tid's
into a TEMP dbase and selecting distinct from there, although it sure is
messy!
--
po**@sixbit.org
SDF Public Access UNIX System - http://sdf.lonestar.org