Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    New Coder
    Join Date
    Jan 2009
    Posts
    23
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Little help with php code read MySQL data base

    Hello,

    1. I have one webdomain, for example: www.mydomain.com, when I installed php-fusion v.7.
    2. I have one sub domain web, for example: forum.mydomain.com, when I installed Invision Power Board forum v.2.3.6.

    I want php-fusion panel to read and display last five active topic from Invision Power Board forum. And the Invision Power Board forum has own MySQL database. So, I have two MySQL database: PHP-Fusion and Invision Power Board.

    In php-fusion, at the option of creating a new panel, is displayed:
    PHP Code:
    openside("name");
      echo 
    "content";
    closeside(); 
    I replaced "content" of the php code posted above, with the following php code should read the MySQL database called IPB Forum: forumel_phpb1. Therefore, result:
    PHP Code:
    openside("name");
      echo 
    "
    global $forumel, $phpb1, $forum;

    $result = $db->sql_query("
    SELECT forum_idtopic_idtopic_title FROM ".$prefix."_bbtopics ORDER BY topic_time DESC LIMIT 5");
    $content = "
    <br>";
    while ($row = $db->sql_fetchrow($result)) {
       $forum_id = intval($row['forum_id']);
       $topic_id = intval($row['topic_id']);
       $topic_title = $row['topic_title'];
       $row2 = $db->sql_fetchrow($db->sql_query("
    SELECT auth_viewauth_read FROM ".$prefix."_bbforums WHERE forum_id='$forum_id'"));
       $auth_view = intval($row2['auth_view']);
       $auth_read = intval($row2['auth_read']);
       if (($auth_view < 2) OR ($auth_read < 2)) {
           $content .= "
    <img src="images/arrow.gif\" border=\"0\" alt=\"\" title=\"\" width=\"9\" height=\"9\">&nbsp;<a href=\"modules.php?name=Forums&amp;file=viewtopic&amp;t=$topic_id\">$topic_title</a><br>";
       }
    }

    $content .= "<br><center><a href=\"modules.php?name=Forums\"><b>$sitename Forums</b></a><br><br></center>";
    ";
    closeside(); 
    The php code above don't works and I don't know why??? So, I want to tell me what was wrong or what you should add in the php code above to read the MySQL database Invision Power Board? I want php-fusion to be displayed only five titles last active forum topics.

    Little help please.

  • #2
    New Coder
    Join Date
    Jan 2009
    Posts
    23
    Thanks
    0
    Thanked 0 Times in 0 Posts
    UP! anyone! Please.

  • #3
    UE Antagonizer Fumigator's Avatar
    Join Date
    Dec 2005
    Location
    Utah, USA, Northwestern hemisphere, Earth, Solar System, Milky Way Galaxy, Alpha Quadrant
    Posts
    7,691
    Thanks
    42
    Thanked 637 Times in 625 Posts
    Does your $db object report query errors?

  • #4
    New Coder
    Join Date
    Jan 2009
    Posts
    23
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Do not report any error. I just tried to implement a code to read and display the latest IPB active topics in a panel php-fusion, but the php code, which we exposed above, does not work. So...

  • #5
    UE Antagonizer Fumigator's Avatar
    Join Date
    Dec 2005
    Location
    Utah, USA, Northwestern hemisphere, Earth, Solar System, Milky Way Galaxy, Alpha Quadrant
    Posts
    7,691
    Thanks
    42
    Thanked 637 Times in 625 Posts
    I'm sorry I wasn't clear-- my question is, is your $db object written to report errors when they happen? In other words, is there an error happening with your script that you aren't seeing because $db isn't reporting it?

  • #6
    New Coder
    Join Date
    Jan 2009
    Posts
    23
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I understand what you ask me but I do not know what to answer. I do not know because I don't know very well "the problem".

    Have you ever worked with php-fusion? I ask this because to understand what I did and presented the first script above should have worked with CMS php-fusion. In another train of thoughts, above, we tried to implement a php code in a php-fusion panel that reads the MYSQL Invision Power Board. The problem is: we have not succeeded, an error that displays the CMS when I try implement php code above are:
    PHP Code:
    Parse errorsyntax errorunexpected T_STRINGexpecting ',' or ';' in /home/mydomain/public_html/administration/panel_editor.php(128) : eval()d code on line 5 
    So, I need help to correct the errors in php code above.

    And please excuse my english.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •