This works fine:
Code: Select all
$mysql = "SELECT * FROM forum_posts LEFT JOIN forum_topics USING (tid) WHERE forum_posts.text LIKE '%" . $search_term . "%'";If I specify some SELECT columns, including tid, I get the "ambiguous" error. If I just SELECT * tid is returned in the result set OK - but so is a whole pile of other unwanted stuff which is just wasting memory.
So, is there a way to get tid without SELECT'ing * ?
I could create another column "tid_copy" but that sounds like a bit of a hack.
Thanks in advance.