SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    [Call me Bram] iBram007's Avatar
    Join Date
    Feb 2001
    Location
    Belgium
    Posts
    339
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I've got a link database on my own site, in mysql. I wrote a script on hosted on the same server who calls a category with links. That works fine.
    But now, I want to include that file on another host, but that doesn't work... No errors, but no links either...
    What's wrong? When I run the script from it's host, it works fine, but when I try to inlcude it on another host, it doesn't work...

  2. #2
    SitePoint Enthusiast RandMan's Avatar
    Join Date
    Mar 2001
    Location
    Crossville, TN USA
    Posts
    48
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    To clarify my thinking:
    You have a database on one host/computer and you want to access that database from another host/computer?

    If I understand what you are asking I don't think it can be done conventionally.

    Solving the problem is multi-part:
    -script to access the database
    -create a web page
    -open that web page [url]
    -parse out the data you need

  3. #3
    Serial Publisher silver trophy aspen's Avatar
    Join Date
    Aug 1999
    Location
    East Lansing, MI USA
    Posts
    12,937
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This is all very possible to do.

    You can query a MySQL DB remotely.

    mysql_connect(host, user, pw);

    if you leave host out it assumes its local host but if you know the IP of the mysql server you can connect to it from anywhere in the world.

    As for the way you have it set up now

    parsing script -> fetching script -> database

    I can't tell you why that doesn't work without seeing the parsing script. But you may want to consider just connecting straight to the mysql db from the other host.
    Chris Beasley - I publish content and ecommerce sites.
    Featured Article: Free Comprehensive SEO Guide
    My Guide to Building a Successful Website
    My Blog|My Webmaster Forums

  4. #4
    Mlle. Ledoyen silver trophy seanf's Avatar
    Join Date
    Jan 2001
    Location
    UK
    Posts
    7,168
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi,

    If you can't do what aspen said you could just grab the output of the script on your site :

    PHP Code:
    $output implode("",file("http://www.yoursite.com/script.php")); 
    The output of the file will then be stored in the variable $output

    Sean

  5. #5
    [Call me Bram] iBram007's Avatar
    Join Date
    Feb 2001
    Location
    Belgium
    Posts
    339
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    yeah seanf, works great!


Bookmarks

Posting Permissions

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