a6april

a6april

Joined
Nov 08, 2012

Activity Stream

a6april commented on a Page, CSV to mySQL - Create Table and Insert Data  -  Nov 11, 2012

Can you point me in the right direction to find out what those changes would be? I don't mind starting small and moving from there, I can email you the zip of everything I have done so far.

 Respond  
a6april commented on a Page, CSV to mySQL - Create Table and Insert Data  -  Nov 10, 2012

Can't the table name be the name of the csv file? or a temp file in the code? I have seen it done before but can't find the instance in which I had done this. I will look again harder to find it.

Ultimately I have a csv file that a user will upload then I can run queries on it. There are many different csv files slightly different in format, so I would then have to create a script to tailor each scenario? I think that means a new table for each file template?

 Respond  
a6april commented on a Page, CSV to mySQL - Create Table and Insert Data  -  Nov 08, 2012

How do I add a browse button for this?

Lets say I need to select the file can I use something like:

//get the csv file
$file = $_FILES[csv][tmp_name];
$handle = fopen($file,"r");

With a form like this:

Choose your file:

I tried using the script as is and I always get the error:
'Please provide a file name'

I would really like to get this working so any additional information would be greatly appreciated

Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.