Welcome Guest, Not a member yet? Register   Sign In
Dumping Data into a Database application
#1

[eluser]Unknown[/eluser]
Hi guys,

I am currently working on a project and I need to populate the database with sets of data. Currently we are using a web interface to enter this data one by one and I am thinking there should be a way of dumping these data all in a go. I read here about Scaffolding and its shortcomings. I was wondering if there are other ways I could get to load these data into the database without having to expose the application to any serious security risks?

Your tips and advices are most appreciated.

Aboladebaba.
#2

[eluser]n0xie[/eluser]
You can import csv's or xml's quite easily. So I would start with that.
#3

[eluser]Jaketoolson[/eluser]
As n0xie suggested, importing files into CSV or XML is easily done. For a few of our web-based services, we develop 22+ csv's each day and import into the database using a query similar to the example below.

Code:
"LOAD DATA LOCAL INFILE 'name.csv'
REPLACE INTO TABLE `tablename`
FIELDS TERMINATED BY '\\t'
FIELDS OPTIONALLY ENCLOSED BY '\"'
LINES TERMINATED BY '\\n'"

More @ MySql




Theme © iAndrew 2016 - Forum software by © MyBB