** ONLINE DATA INSERT --> MYSQL front & PHP script **

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Atz

    ** ONLINE DATA INSERT --> MYSQL front & PHP script **

    Hi to all !

    Im using MySql front and PHP 5 for some web shop.
    I didn't try it so far but i guess that the online data insertation ( accept
    costs and time ) should be the same process like for local connection.

    Problem:
    I have to create online ( on remote server ) some 6 tables and some 20
    fields with MySql front.
    Ok. This shouldn't be great problem ( i hope :-)).
    The bigger problem is that i need to insert cca. 450 products ( into
    differnt tables (products, pro_groups ... ) ) and i dont know how to make
    this online.

    For now ( 20 products ) i made all this thru localhost but now i have to
    insert much more data and all this online...
    The data is sorted thru groups ( 8 major groups ) so every product is part
    of some group.

    How can i insert data, online and how to pass so much products from
    localhost to remote server ( maybe by reading some .txt file ? ).....

    Thanx in advance.


  • Michael Austin

    #2
    Re: ** ONLINE DATA INSERT --> MYSQL front & PHP script **

    Atz wrote:
    [color=blue]
    > Hi to all !
    >
    > Im using MySql front and PHP 5 for some web shop.
    > I didn't try it so far but i guess that the online data insertation ( accept
    > costs and time ) should be the same process like for local connection.
    >
    > Problem:
    > I have to create online ( on remote server ) some 6 tables and some 20
    > fields with MySql front.
    > Ok. This shouldn't be great problem ( i hope :-)).
    > The bigger problem is that i need to insert cca. 450 products ( into
    > differnt tables (products, pro_groups ... ) ) and i dont know how to make
    > this online.
    >
    > For now ( 20 products ) i made all this thru localhost but now i have to
    > insert much more data and all this online...
    > The data is sorted thru groups ( 8 major groups ) so every product is part
    > of some group.
    >
    > How can i insert data, online and how to pass so much products from
    > localhost to remote server ( maybe by reading some .txt file ? ).....
    >
    > Thanx in advance.
    >
    >[/color]

    create a comma-delimited file with ALL of the information and then use the mysql
    LOAD file. This will take just a couple of minutes vs. trying to use a web
    page. When dealing with large amounts of data use the appropriate tool...

    in your connection simply change the HOST to point to either the IP address or
    host name of the remote server:

    # -- CONFIGURE THESE VARIABLES --
    $USR = 'someuser';
    $PWD = 'somepass';
    $DB = 'somedb';
    # $HOST= 'localhost';
    $HOST = '<someipaddress >';
    $link=mysql_con nect($HOST,$USR ,$PWD,$DB);
    .........
    ?>

    You may have firewall issues to deal with if it is not on your local LAN and
    make sure the user has access from the host you are originating or '%'

    update user set host = '%' where user = 'your username';
    or
    update user set host = '<originating IP address>' where user = 'your username';

    --
    Michael Austin.
    Donations welcomed. Http://www.firstdbasource.com/donations.html
    :)

    Comment

    • Atz

      #3
      Re: ** ONLINE DATA INSERT --&gt; MYSQL front &amp; PHP script **

      > create a comma-delimited file with ALL of the information and then use the
      mysql[color=blue]
      > LOAD file. This will take just a couple of minutes vs. trying to use a[/color]
      web[color=blue]
      > page. When dealing with large amounts of data use the appropriate tool...
      >
      > in your connection simply change the HOST to point to either the IP[/color]
      address or[color=blue]
      > host name of the remote server:
      >
      > # -- CONFIGURE THESE VARIABLES --
      > $USR = 'someuser';
      > $PWD = 'somepass';
      > $DB = 'somedb';
      > # $HOST= 'localhost';
      > $HOST = '<someipaddress >';
      > $link=mysql_con nect($HOST,$USR ,$PWD,$DB);
      > ........
      > ?>[/color]
      [color=blue]
      > You may have firewall issues to deal with if it is not on your local LAN[/color]
      and[color=blue]
      > make sure the user has access from the host you are originating or '%'
      > update user set host = '%' where user = 'your username';
      > or update user set host = '<originating IP address>' where user = 'your[/color]
      username';
      ------------------------------------

      Thanx Michael for this answer but i don't get it what do u meen under ALL.

      Table Product_Categor y is related with table Products

      E.g. fields for products TABLE:
      ID (Auto-Pk), Code, Name, ShortName, Description, LongDescription , Prize,
      Date.

      ***
      Product_Groups TABLE
      product_id, category_id

      -------------------------------------------------------------
      So basicly you suggest something like this:

      1, 1001, radio, ra, Small radio, Small radio for cars and other places, 100,
      12.09.2004 ;
      2, 1002, radioo, ra2, Small radio, Small radio for cars and other places,
      110, 12.09.2004 ;
      3, 1003, cradio, ra3, Small radio, Small radio for cars and other places,
      110, 12.09.2004 ;

      Products_Groups
      1 , 1 ;
      2 , 1 ;
      3, 1 ;
      ------------------------------------------------------------
      Like i write before, tables products and products_groups are connected

      If i enter all the data at once into one table ( products ), can i enter
      then all data in the products_groups table ( becuse of relations ) or must i
      make insert on the way that
      i make insertation of first product ( products table ) and then his categori
      and id ( in the products_group table ) and so on....

      I ask this becuse of the sorting in the txt file.


      Thanx







      Comment

      Working...