Page 1 of 1

Mysql how do i mass upload data

Posted: Sat May 30, 2009 8:28 am
by baabaashep
OK I'm on basic newbie level here so pls bear with me....
I am trying to think this through before I start and I need some help

I'll cut this down to get to them point

I am going to make a "Property listing Database" here are the two table I will ask about:

table 1: User details
table 2: property details

As Admin I want to be able to upoad 50 new users (on their behalf bypassing the user) with a given username and password (users need to be registered before they can add a property. I then want to upload their 50 property details

I can them simply e-mail the user with their login details and their property will already be in there

Is this possible via csv or something like that?
I think it's a Mass upload solution I need but many will know better than me

Any help would be appreciated
Pete

Re: Mysql how do i mass upload data

Posted: Sat May 30, 2009 8:45 am
by josh
for 50 records which is laughably small data just use phpmyadmin's import feature. For large databases like 50 million .zip up your mysql data dir and unzip it on the target server

Re: Mysql how do i mass upload data

Posted: Sat May 30, 2009 12:09 pm
by califdon
If you have the availability of phpmyadmin, Josh has suggested the easiest solution. In case you don't, you may want to look at the SQL command LOAD DATA INFILE. As he said, the choice of method for loading batches of data depends on how much data you have and in what format it already exists. There are several methods that could be used under different circumstances.

Re: Mysql how do i mass upload data

Posted: Sat May 30, 2009 6:16 pm
by baabaashep
Thanks for the input
The number of records isn't important.

I think I may actually be looking for help on a script(php perhaps?) that will allow the upload of data via a csv file actually

I want an idiot proof way of uploading data to the db - for the user as well. Perhaps online through a php form or script to the db?
All the user should have to do is complete the csv file, press upload and all the properties will upload(as opposed to them inputting one at a time) to the db

I hope I am I making sense here ..... :?
any help appreciated...
Thanks
Pete

Re: Mysql how do i mass upload data

Posted: Sat May 30, 2009 11:59 pm
by califdon
There is no such thing as idiot proof. The more automatic you make it, the worse the problems become when something goes wrong with the CSV format, because you are not there to handle the problem. But if you have a stable, reliable way to create the CSV file, then the script is easy, that's why I referred you to the LOAD DATA INFILE command.

Re: Mysql how do i mass upload data

Posted: Sun May 31, 2009 8:33 am
by baabaashep
Thanks
I will need to look this up

Pete