uploading data to a database

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
Vegan
Forum Regular
Posts: 574
Joined: Fri Sep 05, 2008 3:34 pm
Location: Victoria, BC
Contact:

uploading data to a database

Post by Vegan »

I have 2 CSV files uploaded to my Linux VM, one is IPv4 and the other is IPv2 and I have 2 tables for them respectively.

The purpose is to be able to build a better ad rotator for global internet traffic

IPv4:

Code: Select all

LOAD DATA LOCAL
	INFILE 'IP2LOCATION-LITE-DB1.CSV'
INTO TABLE
	`ip2location_db1`
FIELDS TERMINATED BY ','
ENCLOSED BY '"'
LINES TERMINATED BY '\r\n'
IGNORE 0 LINES;
IPv6:

Code: Select all

LOAD DATA LOCAL
	INFILE 'IP2LOCATION-LITE-DB1.IPV6.CSV'
INTO TABLE
	`ip2location_db1_ipv6`
FIELDS TERMINATED BY ','
ENCLOSED BY '"'
LINES TERMINATED BY '\r\n'
IGNORE 0 LINES;
So any ideas on how to update the database dynamically? I was considering mostly IPv4 until IPv6 becomes more widely available.

For now I have them manually setup, but eventually I wanted to use JavaScript and correct the database with a POST command os something

databases are not too large, 24,000 rows for IPv6 is easy to manage
Hardcore Games™ Legendary is the Only Way to Play™
My site is powered by LAMP
Post Reply