doddsey_65 Posted March 15, 2011 Share Posted March 15, 2011 Hi, im trying to set up a tooltip whereby the user hovers over a forum name and it shows the first 5 topics within that forum in the tooltip. However i cant get it to display the topics properly. It just displays the same topics in all tooltips(3 in total). $topic_preview = array(); $query = $link->query("SELECT f.*, t.t_name FROM ".TBL_PREFIX."forums f LEFT JOIN ".TBL_PREFIX."topics as t ON (t.t_fid = f.f_fid) GROUP BY f.f_fid ORDER BY f.f_fid ASC")or die(print_link_error()); while($row = $query->fetch(PDO::FETCH_ASSOC)) { $topic_preview[] = $row['t_name']; } echo implode('<br />', $topic_preview); anyone have any ideas? Thanks Quote Link to comment https://forums.phpfreaks.com/topic/230722-tooltip-problem/ Share on other sites More sharing options...
ChemicalBliss Posted March 15, 2011 Share Posted March 15, 2011 I see no variables in your query, your query therefor never changes and so your data is always the same regardless of what forum. How are you using this? ie. Are you putting it in the actual forum list generation code? or template code? you need to know which forum you want to get the topics from (WHERE clause). Quote Link to comment https://forums.phpfreaks.com/topic/230722-tooltip-problem/#findComment-1187865 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.