samporras Posted January 8, 2007 Posted January 8, 2007 hey guys. It's been a while since i posted to this forum. Hope everyone is doing great and had a fun 2006. So as part of my new years resolution, i told myself i was going to learn more about working with PHP and MySQL. I have become pretty comfortable working with HTML and CSS, but the only back end programming languages that i have am comfortable with are ASP and C#. I'm slowly begining to understand PHP and MySQL (I bought the book Sams Teach Yourself PHP, MySQL and Apache All in One and am slowly trudging through it), but still had a few questions... do you guys know if there are any online examples or anything of the sort to import data from an excel sheet into a mysql database? those of you that work with MySQL, what is the most common way to populate data into a database (besides manually entering)? Also any additional online tutorials would be great! Thanks! Sam Quote
TCH-Andy Posted January 8, 2007 Posted January 8, 2007 If you do a Google search, there are a few tutorials and examples. I haven't used any so I don't know how good they are. Personally, if I was going to transfer from Excel to MySQL I'd probably save it as a CSV and then something like the following from cpanel; >LOAD DATA LOCAL INFILE 'filename.csv' INTO TABLE table FIELDS TERMINATED BY ',' ENCLOSED BY '"' LINES TERMINATED BY '\n'; You could also code PHP to read the file and place the data into the tables. Although I'm sure there will be folk along to tell you a better method though ... Quote
samporras Posted January 8, 2007 Author Posted January 8, 2007 Personally, if I was going to transfer from Excel to MySQL I'd probably save it as a CSV and then something like the following from cpanel; >LOAD DATA LOCAL INFILE 'filename.csv' INTO TABLE table FIELDS TERMINATED BY ',' ENCLOSED BY '"' LINES TERMINATED BY '\n'; Thanks Andy. This sounds very do-able for a beginner. I will mess around with it tonight and let you know what i come up with. Sam Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.