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
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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.