Members: 15,141
Threads: 38,828
Posts: 159,362
Online: 24

Newest Member: batterygogo



Go Back   Mambers.com > Development > Development Discussions

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Old 12.11.2004, 20:01   #1
Admin
Administrator
 
Join Date: Mar 2004
Posts: 807
Admin will become famous soon enough
RedCross Help needed with mysql JOIN statement

Hi everybody,

I'm currently moving AkoComment to 451. The component is ready, the content Mambot is ready, but the new Searchbot does not work fine. Here's the sql statement:

PHP Code:
  $database->setQuery"SELECT CONCAT(c.title,' - ',a.title) AS title,"
    
"\n a.comment AS text,"
    
"\n a.date AS created,"
    
"\n 'Comment' AS section,"
    
"\n CONCAT('index.php?option=com_content&task=view&id=',a.contentid,'&Itemid=',m.id,'#akocomment',a.id) AS href,"
    
"\n '2' AS browsernav"
    
"\n FROM #__akocomment AS a"
    
"\n LEFT JOIN #__menu AS m ON m.componentid = a.contentid"
    
"\n LEFT JOIN #__content AS c ON c.id = a.contentid"
    
"\n WHERE a.comment LIKE '%$text%'"
    
"\n AND a.published='1'"
    
"\n ORDER BY a.date"
  
); 
The problem is located somewhere in the JOIN tags (I'm no sql ace, so please forgive me even larger errors).

All comments in AkoComment 2.0 will have a target for direct linking from within the Searchbot. Therefore I use the CONCAT command in the link. The link is checked by Mambo when it will be returned by the bot. If Mambo detects a missing Itemid, it adds the correct Itemid to the end. But this does not work for me, as I need the target at the end of the link. Therefore I have to find out the correct Itemid myself (which I try with the first JOIN).

Sadly this causes troubles and does not return results for all found items.

The second JOIN grabs the content item title. This is needed because a comment in AkoComment could have no own title. But as the title is used as the links description I have to be sure and therefore add the content title in the front.

Any ideas? Please help fast so I could release the new version fast...
__________________
Regards,
Arthur Konze
Webmaster @ Mamboportal.com - Mambers.com
Admin is offline   Reply With Quote
Sponsored Links
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Why is MySQL not recognized? leohordijk Mambo 4.5.1 Installation and Upgrades 2 09.11.2004 14:57
MySQL statement question loom001 Mambo 4.5.1 General Talk 0 17.10.2004 20:15
Need to change a mysql statement in Zoom Gallery blay Component 'How Do I' Questions 0 23.08.2004 22:17
Establishing a MySQL database kippwinger Mambo 4.5.1 Installation and Upgrades 2 20.08.2004 08:17
MySQL statement help hawkmultimedia Mambo 4.5 'How Do I' Questions 3 28.06.2004 13:55


All times are GMT +2. The time now is 09:28.

Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
A vBSkinworks Design
© Copyright 2004-2008 by Arthur Konze Webdesign.