Results 1 to 3 of 3

Thread: php import help

  1. #1
    Meyer is offline Sugar Community Member
    Join Date
    Oct 2006
    Location
    south africa
    Posts
    646

    Default php import help

    What am i doing wrong here?


    <?php
    $dbhost1 = "dedi212.jnb2.host-h.net";
    $dbuser1 = "";
    $dbpassword1 = "";
    $db1 = "risingfs_rcjan2010";
    $connection1 = mysql_connect($dbhost1,$dbuser1,$dbpassword1) or die (mysql_error());
    mysql_select_db($db1,$connection1);

    $dbhost2 = "41.66.140.74";
    $dbuser2 = "";
    $dbpassword2 = "";
    $db2 = "edutoy";
    $connection2 = mysql_connect($dbhost1,$dbuser1,$dbpassword1) or die (mysql_error());
    mysql_select_db($db2,$connection2);


    $mysql_query ="
    INSERT INTO risingfs_rcjan2010.aa(risingfs_rcjan2010.aa.a,risi ngfs_rcjan2010.aa.b)

    SELECT edutoy.products.id,edutoy.products.NAME FROM edutoy.products.products

    }
    ?>

  2. #2
    d1m0's Avatar
    d1m0 is offline Senior Member
    Join Date
    Nov 2009
    Posts
    86

    Default Re: php import help

    For starters, I don't see a mysql user and password added. If you want to connect to your database, you'll have to create a mysql user and grant it privileges to access the database(s).

    Of course, you may have removed these for security reasons (I wouldn't want my mysql details listed in a forum either).

    Thus, if you want us to try and help you, you should tell us what exactly you want to achieve, as well as provide us with the exact error message you receive.
    SiteGround Technical Support Team Member
    Check out our special SugarCRM hosting package

  3. #3
    Meyer is offline Sugar Community Member
    Join Date
    Oct 2006
    Location
    south africa
    Posts
    646

    Default Re: php import help

    You are correct. i do not show my logoon details.

    What i want to achieve is, i have my sugar crm database on this server. but on another server different host i have a data warehouse.

    I need to everynight import data from my sugar database to my data warehouse table.
    I get no errors but also nothing happens. It works with apatar integration but i need this in php code.

    <?php
    my warehouse db
    $dbhost1 = "dedi212.jnb2.host-h.net";
    $dbuser1 = "";
    $dbpassword1 = "";
    $db1 = "risingfs_rcjan2010";
    $connection1 = mysql_connect($dbhost1,$dbuser1,$dbpassword1) or die (mysql_error());
    mysql_select_db($db1,$connection1);

    // my sugar db
    $dbhost2 = "41.66.140.74";
    $dbuser2 = "";
    $dbpassword2 = "";
    $db2 = "edutoy";
    $connection2 = mysql_connect($dbhost1,$dbuser1,$dbpassword1) or die (mysql_error());
    mysql_select_db($db2,$connection2);

    // my query

    $mysql_query ="
    INSERT INTO risingfs_rcjan2010.aa(risingfs_rcjan2010.aa.a,risi ngfs_rcjan2010.aa.b)

    SELECT edutoy.products.id,edutoy.products.NAME FROM edutoy.products.products

    }

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. import module - import leads with error fields also
    By dsuvankar in forum Developer Help
    Replies: 0
    Last Post: 2010-06-28, 03:46 PM
  2. import module - import leads with error fields also
    By dsuvankar in forum Developer Help
    Replies: 0
    Last Post: 2010-06-28, 03:36 PM
  3. Replies: 4
    Last Post: 2009-08-05, 08:14 PM
  4. Replies: 2
    Last Post: 2009-03-14, 08:34 PM
  5. Replies: 0
    Last Post: 2005-06-29, 10:43 PM

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
  •