Jump to content

Tooltip problem


doddsey_65

Recommended Posts

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

Link to comment
https://forums.phpfreaks.com/topic/230722-tooltip-problem/
Share on other sites

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).

Link to comment
https://forums.phpfreaks.com/topic/230722-tooltip-problem/#findComment-1187865
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.