By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
426,012 Members | 988 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 426,012 IT Pros & Developers. It's quick & easy.

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

P: n/a
Atz
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.
Jul 17 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Atz wrote:
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.


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_connect($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
:)
Jul 17 '05 #2

P: n/a
Atz
> 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_connect($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';
------------------------------------

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

Table Product_Category 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



Jul 17 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.