1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

How Do I Connect From Within WP To An External MySQL Product DB Who Is On The Same Domain?

Discussion in 'Blogging' started by bugschaser, Aug 2, 2010.

Tags:
  1. bugschaser

    bugschaser Registered Member

    Joined:
    Jul 28, 2008
    Messages:
    85
    Likes Received:
    29
    Occupation:
    IT Manager
    Location:
    Expat in Asia
    Hi

    Is this even possible? From what I saw on the net, there were problems too. Does anyone has a working script/blueprint? I need to show some products on any WP page, post or otherwise (with paging).

    Any help would be very much appreciated.

    R.
     
  2. whatsup

    whatsup Registered Member

    Joined:
    Feb 2, 2008
    Messages:
    50
    Likes Received:
    7
    Not sure if I understand what you try to do.

    You can have php / mysql statement in posts or pages if you install a plugin like i.e. phpexec

    Or you can use csv importer plugin to import data from your other db as wp posts.
     
    • Thanks Thanks x 1
  3. bugschaser

    bugschaser Registered Member

    Joined:
    Jul 28, 2008
    Messages:
    85
    Likes Received:
    29
    Occupation:
    IT Manager
    Location:
    Expat in Asia
    Hi

    I forgot that the plugin phpexec exist, have to research that. Other than that, I read that there were problems using php/mysql statements in posts (for security reasons, I guess). Perhaps not all hosts allow phpexec to work to its full extent

    What I want to do is if anyone is searching for a particular product from an external mysql database (but on the same domain), it shows in wordpress the result on a tabled result page. Can be on the same page as long one of the paging plugins works. Further, the search result will appear on a 'page' rather than as a new 'post' which will be cleared every time. Guess this is the best way

    Thanks for replying. Any other or better idea is still welcome.

    R.
     
  4. corbin2

    corbin2 Registered Member

    Joined:
    Jan 16, 2010
    Messages:
    66
    Likes Received:
    41
    You have to create a template file. Put your MYSQL query in there, create a page and choose the template file you've created. That should do the job.

    To get paging to work... Well that would be a lot harder I think. No idea about that.