Jump to:

5450 Posts in 1672 Topics by 1197 members

Customising the CMS

SilverStripe Forums » Customising the CMS » Use Silverstripe page to Load Other database

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 1777 Views
  • acefx
    Avatar
    Community Member
    8 Posts

    Use Silverstripe page to Load Other database Link to this post

    Hi

    I'm trying to load the content of another database and showcase it in tree on my page. The problem is that i can just get Silverstripe to load the content of the DB.
    Also i want to create a drop down using : 'Issue' => 'Drop', but its not working and i also tried dropdown and list but non worked.

    Can anyone help me out

    Thanks

  • acefx
    Avatar
    Community Member
    8 Posts

    Re: Use Silverstripe page to Load Other database Link to this post

    I was able to load the database at last by just creating a function that handles all the connection.

    function tre()
       {
          
          return "This could be HTML/Text/Images or PHP";

          
          $sava = "localhost";
          $usa = "root";
          $pas = "not to worry";
          
          $db = "mysite";
          
          $con = mysql_connect($sava, $usa, $pas);
          
          $ue = mysql_select_db($db);
          
          
          
          $info = "SELECT * FROM broad";
          
          $inf = mysql_query($info) or die(mysql_error());
          
          while ($ini = mysql_fetch_array($inf, MYSQL_ASSOC))
          {
             //return "<ul><li>". $ini["id"]. "</li><li>". $ini["user"]. "</li></ul>";
          }
          
       }
       

    But i can load it to the appropriate location in the page

  • Jainx
    Avatar
    Community Member
    1 Post

    Re: Use Silverstripe page to Load Other database Link to this post

    Thanks for posting the function!
    Gonna give it a go myself

  • swaiba
    Avatar
    Forum Moderator
    1769 Posts
    1777 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.