Jump to content

Recommended Posts

And too bad I dont know anything about mysql to make it shorter?

 

 SELECT DISTINCT(ibf_posts.author_id),
                        ibf_topics.*,
                        mr.mgroup,
                        mr.desktop as desktop2,
                        ibf_members.desktop,
                        ibf_members.id, ibf_members.mgroup, ibf_groups.g_id FROM ibf_topics
                           LEFT JOIN ibf_posts ON
                       (ibf_topics.tid=ibf_posts.topic_id AND ibf_posts.author_id=".$ibforums->member['id'].")
                          LEFT JOIN ibf_members ON (starter_id=ibf_members.id)
                           LEFT JOIN ibf_members mr ON (mr.id=last_poster_id)
                           LEFT JOIN ibf_groups ON (ibf_groups.g_id=ibf_members.mgroup)
                              LEFT JOIN ibf_groups g ON (g.g_id=mr.mgroup)
                           WHERE ibf_topics.forum_id=".$this->forum['id']."
                                   and ibf_topics.approved=1
                                   and (ibf_topics.pinned=1 or ibf_topics.last_post > $Prune)
                                

 

There has to be a way right?.. This is for my forum system, it was wrote in 2003 this is to display list of Topics(Forums.php)

 

Can somone please be really generous right and sum this query up or tell me how I can?

 

Thanks.. lol

 

 

Hi, i made is smaller:

 

SELECT DISTINCT(ibf_posts.author_id), ibf_topics.*, mr.mgroup, mr.desktop as desktop2, ibf_members.desktop, ibf_members.id, ibf_members.mgroup, ibf_groups.g_id FROM ibf_topics
                       LEFT JOIN ibf_posts ON
                       (ibf_topics.tid=ibf_posts.topic_id AND ibf_posts.author_id=".$ibforums->member['id'].")
                   LEFT JOIN ibf_members ON (starter_id=ibf_members.id)
                   LEFT JOIN ibf_members mr ON (mr.id=last_poster_id)
                   LEFT JOIN ibf_groups ON (ibf_groups.g_id=ibf_members.mgroup)
                      LEFT JOIN ibf_groups g ON (g.g_id=mr.mgroup)
                       WHERE ibf_topics.forum_id=".$this->forum['id']."
                       and ibf_topics.approved=1
                       and (ibf_topics.pinned=1 or ibf_topics.last_post > $Prune)

 

can people make it smaller?  lol

Link to comment
https://forums.phpfreaks.com/topic/172439-this-query-is-way-to-big/
Share on other sites

  • 2 weeks later...
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.