Jump to content


Corporate Sponsors


Latest News: (loading..)

* * * * * 3 votes

Export / Edit and Import an Excel CSV via phpmyadmin


110 replies to this topic

#41 matrix2223

  • Community Member
  • 859 posts
  • Real Name:Eric
  • Gender:Male
  • Location:MD USA

Posted 04 April 2006, 06:20

Maybe someone in here can help me.

I have tried to export the tables as described, I have read and understand what you are saying but my myphpAdmin does have the Windows or a zip button and everytime I try it a different way it wants me to download the whole SQL file ie a backup.

I also am not so sure this will even work for me because I have a ^ delimited products.dat file(which can be opened by EL and open office) and the line returns well there is none
ex. product_name^item^3.90

Could someone give me a general idea how I could add a this kind of file. Because I agree with the other guy who posted on page one that EP&PA and even the excel import didnt work.

Maybe I should just stick to snail pace. I dunno

Thanks for any help,
Eric

Keep up on osCommerce changes and updates at Github | Understand osCommerce a little further at OsCommerce Documentation | Copy and paste your error message in Google add "in osCommerce" at the end to get relevant answers to most issues.


#42 thewrath1

  • Community Member
  • 59 posts
  • Real Name:Gaz

Posted 04 April 2006, 19:11

View Postmatrix2223, on Apr 4 2006, 06:20 AM, said:

Maybe someone in here can help me.

I have tried to export the tables as described, I have read and understand what you are saying but my myphpAdmin does have the Windows or a zip button and everytime I try it a different way it wants me to download the whole SQL file ie a backup.

I also am not so sure this will even work for me because I have a ^ delimited products.dat file(which can be opened by EL and open office) and the line returns well there is none
ex. product_name^item^3.90

Could someone give me a general idea how I could add a this kind of file. Because I agree with the other guy who posted on page one that EP&PA and even the excel import didnt work.

Maybe I should just stick to snail pace. I dunno

Thanks for any help,

What version of PHPMyAdmin are you running? My example's were originally posted when I was using 2.6.1, and should be compatible upward.

If you can't export, then I would suggest updating PMA, if your host allows.

Meanwhile: just for those who don't understand the basics of exporting a table, below are some visual guides.

Hope they help :-)

[img]http://www.euro-guard.co.uk/images/basic1.gif[/img]

[img]http://www.euro-guard.co.uk/images/basic2.gif[/img]

[img]http://www.euro-guard.co.uk/images/basic3.gif[/img]

Following these steps will provide you with a CSV on your desktop.

If you want it zipped, Zip it.
Q/ How many therapist's does it take to change a lightbulb?
A/ Two. But the lightbulb has to really 'want' to change.

#43 matrix2223

  • Community Member
  • 859 posts
  • Real Name:Eric
  • Gender:Male
  • Location:MD USA

Posted 05 April 2006, 01:05

My myphpAdmin is version 2.4.0 I have the csv part but not the EL options and it looks way different.

If I know how to post a screen shot I would do that so everyone can see.

Thanks for the help
Eric

Keep up on osCommerce changes and updates at Github | Understand osCommerce a little further at OsCommerce Documentation | Copy and paste your error message in Google add "in osCommerce" at the end to get relevant answers to most issues.


#44 AlanR

  • Community Member
  • 3,711 posts
  • Real Name:Alan Rogers

Posted 05 April 2006, 01:46

View Postmatrix2223, on Apr 4 2006, 09:05 PM, said:

My myphpAdmin is version 2.4.0 I have the csv part but not the EL options and it looks way different.

If I know how to post a screen shot I would do that so everyone can see.

Thanks for the help
2.4.0?

You're way, way behind. The current version is 2.8.0.2. I suggest you download and install the most recent stable version, you'll be glad you did.
Local: Mac OS X 10.5.8 - Apache 2.2/php 5.3.0/MySQL 5.4.10 • Web Servers: Linux
Tools: BBEdit, Coda, Versions (Subversion), Sequel Pro (db management)

#45 Nanci

  • Community Member
  • 53 posts
  • Real Name:Nancy

Posted 05 April 2006, 16:43

WOW, those screen shots are fantastic. I sure wish more people would do that. I'm so lost!!!! But I took Vger's advice, from another topic, and bought PHP & MySQL for dummies. But even that is hard to understand. So does that mean I really am a dummy....oh shit :(
But really, I am learning so much and I appreciate all of this help!

#46 Nanci

  • Community Member
  • 53 posts
  • Real Name:Nancy

Posted 05 April 2006, 16:48

And can I ask a dumb question...sorry in advance...
Since I have a hosting company that has PHP and MySQL available,( but I can't really play with it until I upgrade my service...which I'm not ready to do...) You show the Myphpadmin page... is that a generic page that everyone gets to from their hosting company or do you have to go to the PHP site to do what you are talking about. Sorry to be such a beginner....:(

#47 AlanR

  • Community Member
  • 3,711 posts
  • Real Name:Alan Rogers

Posted 05 April 2006, 16:58

View PostNanci, on Apr 5 2006, 12:48 PM, said:

And can I ask a dumb question...sorry in advance...
Since I have a hosting company that has PHP and MySQL available,( but I can't really play with it until I upgrade my service...which I'm not ready to do...) You show the Myphpadmin page... is that a generic page that everyone gets to from their hosting company or do you have to go to the PHP site to do what you are talking about. Sorry to be such a beginner....:(
Most hosting companies provide a shared version of phpMyAdmin available to all users these days but it's often an older version with some of the best features disabled because a common or shared version can not support the server specific settings.

It's not hard to install although the directions are a little cryptic.
Local: Mac OS X 10.5.8 - Apache 2.2/php 5.3.0/MySQL 5.4.10 • Web Servers: Linux
Tools: BBEdit, Coda, Versions (Subversion), Sequel Pro (db management)

#48 Nanci

  • Community Member
  • 53 posts
  • Real Name:Nancy

Posted 06 April 2006, 00:24

Okay, so if they have this older, out dated version....that everyone uses, would I be allowed or able to download it myself and use my own or in those circumstances do you have to use the older, out dated version because it's all that is allowed??
Or would you suggest finding a hosting company that does allow it??
THANKS!!!

#49 AlanR

  • Community Member
  • 3,711 posts
  • Real Name:Alan Rogers

Posted 06 April 2006, 00:30

View PostNanci, on Apr 5 2006, 08:24 PM, said:

Okay, so if they have this older, out dated version....that everyone uses, would I be allowed or able to download it myself and use my own or in those circumstances do you have to use the older, out dated version because it's all that is allowed??
Or would you suggest finding a hosting company that does allow it??
THANKS!!!
If you can install and run osC you can install and run phpMyAdmin. It's just another php based application.
Local: Mac OS X 10.5.8 - Apache 2.2/php 5.3.0/MySQL 5.4.10 • Web Servers: Linux
Tools: BBEdit, Coda, Versions (Subversion), Sequel Pro (db management)

#50 selmaboyd

  • Community Member
  • 102 posts
  • Real Name:Selma Boyd

Posted 08 April 2006, 10:49

Can anybody tell me why my new products don't show up in the products to categories section on myPHP? I see them after I imported them on the products listing, but they don't show up under products to categories. Note, to make life easier I first exported the original products php file and added my products according to the columns. The file appears to have imported successfully what's wrong now?

#51 selmaboyd

  • Community Member
  • 102 posts
  • Real Name:Selma Boyd

Posted 08 April 2006, 22:22

View Postthewrath1, on Dec 5 2005, 11:07 PM, said:

Check out the example picture.

I hope this explains things a bit easier...
[img]http://www.euro-guard.co.uk/images/instructions_csv_idiots.gif[/img]

That screenshot was excellent. It helps but now I am not getting the products_to_categories to show any of the new records that are showing up in the products section. I have set all of my products_ids to match what was initially there, but the new products wont show anywhere else. Am I missing something? Does anyone have a script I can write in mySQL to create my products database over from scratch? and If so, could you explain to me what ways to change the verbiage so that I can make my own columns? I am sorry but I don't understand php language, looks like html but the latin version to it...LOL

#52 selmaboyd

  • Community Member
  • 102 posts
  • Real Name:Selma Boyd

Posted 08 April 2006, 23:50

View Postselmaboyd, on Apr 8 2006, 06:22 PM, said:

That screenshot was excellent. It helps but now I am not getting the products_to_categories to show any of the new records that are showing up in the products section. I have set all of my products_ids to match what was initially there, but the new products wont show anywhere else. Am I missing something? Does anyone have a script I can write in mySQL to create my products database over from scratch? and If so, could you explain to me what ways to change the verbiage so that I can make my own columns? I am sorry but I don't understand php language, looks like html but the latin version to it...LOL


Okay, so I just got the products_to_Categories to show the new products, but I still don't see it on oscommerce admin. Any help here guys? :( :blink:

#53 datasmog

  • Community Member
  • 15 posts
  • Real Name:ray

Posted 09 April 2006, 10:21

• When IMPORTING, I also had to select "...DATA LOCAL" - as I was getting the error some others in this post referred to: "MySQL said: The used command is not allowed with this MySQL version"

I have tried this every which way without success. I keep getting the above error message.
I've exported into Windows Excel, Mac Excel (I use OS X 10.4.6) and plain old CSV. I've compressed it, and exported it uncompressed. I've exported the file and immediately imported it without making any changes, and I still get the same error.

SQL-query :

LOAD DATA LOCAL INFILE '/tmp/phpymOtDD' REPLACE INTO TABLE `products`
FIELDS TERMINATED BY ','
ENCLOSED BY '"'
ESCAPED BY '\\'
LINES TERMINATED BY '\r\n'

MySQL said:

#1148 - The used command is not allowed with this MySQL version

Yes the escape character has been put in as a double backslash.?
I've also tried removing the \n from Lines Terminated, same result.

Browsers used Safari 2.0.3 and Firefox 1.5.0.1 although I can't see it will make a difference.
phpMyAdmin 2.5.6
MySQL 4.1.7
Apache/2.0.55 (Unix) mod_ssl/2.0.55 OpenSSL/0.9.7a 5.0.5 (Zend: 2.0.5)

Does anyone have any idea why this works for some and yet others keep getting this error?
This, for me at least, is potentially very useful, not only for populating the store but for making changes such as global price changes. With several thousand items that is not something I would care to do through the admin backend.

Help. Please.

#54 selmaboyd

  • Community Member
  • 102 posts
  • Real Name:Selma Boyd

Posted 09 April 2006, 11:24

View Postdatasmog, on Apr 9 2006, 06:21 AM, said:

• When IMPORTING, I also had to select "...DATA LOCAL" - as I was getting the error some others in this post referred to: "MySQL said: The used command is not allowed with this MySQL version"

I have tried this every which way without success. I keep getting the above error message.
I've exported into Windows Excel, Mac Excel (I use OS X 10.4.6) and plain old CSV. I've compressed it, and exported it uncompressed. I've exported the file and immediately imported it without making any changes, and I still get the same error.

SQL-query :

LOAD DATA LOCAL INFILE '/tmp/phpymOtDD' REPLACE INTO TABLE `products`
FIELDS TERMINATED BY ','
ENCLOSED BY '"'
ESCAPED BY '\\'
LINES TERMINATED BY '\r\n'

MySQL said:

#1148 - The used command is not allowed with this MySQL version

Yes the escape character has been put in as a double backslash.?
I've also tried removing the \n from Lines Terminated, same result.

Browsers used Safari 2.0.3 and Firefox 1.5.0.1 although I can't see it will make a difference.
phpMyAdmin 2.5.6
MySQL 4.1.7
Apache/2.0.55 (Unix) mod_ssl/2.0.55 OpenSSL/0.9.7a 5.0.5 (Zend: 2.0.5)

Does anyone have any idea why this works for some and yet others keep getting this error?
This, for me at least, is potentially very useful, not only for populating the store but for making changes such as global price changes. With several thousand items that is not something I would care to do through the admin backend.

Help. Please.

check your MySQL language. I found that these commands are sometimes different for languages...I had lang for MyPHP admin set at en-utf-8 and MySQL connection collation set to cp1251_Ukrainian_ci

This worked but I had to try the different language settings in the MyPHP admin SQL home page. Another thing that worked successfully for me was the contribution at this link:

http://www.oscommerce.com/community/contri...5/category,all/

Start by installing version 1 dated 15 Nov 2002. it comes with very good detailed directions, then install and replace the excel.php file with the upgraded contribution dated 29 Jul 2005.

After this you can see the changes immediately on your oscommerce manager pages. One other note, I prefered to save my files as Tab Deliminated Text, for one, you can work on your spreadsheet in excel and then select Tab Deliminated Text for the save as function. I liked this better than CSV because it uses a simpler seperator [tabs] and it doesn't get confused with anything else that might appear in your spreadsheet. Also, because you can even view and edit in Notepad, which I also liked because you can see all the columns lined up and all you have to do is use tab button to move them over.....this really worked for me because I have thousand of products that each have lengthy descriptions and everything imported and exported in a synch!

:-"

#55 selmaboyd

  • Community Member
  • 102 posts
  • Real Name:Selma Boyd

Posted 09 April 2006, 20:29

View Postkeithratliff, on Nov 15 2005, 11:50 PM, said:

Found the problem.. If anyone is manually importing catalog data with csv files and their products are not showing up.. You have to also modify the table "products_to_categories" to link everything together. So, this is the answer.

You will need to make at least 4 manually modifications. Actually 4 csv files can do all this for you.

1) Create your entry in the "products" table... You will need to know the identifier of this record.
2) Create your entry in the "products_description" table. You will need to use the same identifier to link this description of the item back to the "products" table.
3) Create a category in the "category" table.. You will need remember the record identifier.
4) Create an entry in the "products_to_categories" that link the "products" table entry to the "category" table entry.

I followed everything you said up until directions # 1 I am now totally lost.

Could you please ( or someone else if they have the time) explain to me:

1) what you mean by the "identifier" of the "products" table and how do I figure out what the identifier is?

2) Is the identifier generated by the computer or do I pick my own products id numbers and so on?

3) If my products have their own Manufacturers UPC information for identifying their products, how do I imput them?

4) One more thing, I installed the excel contribution so, I don't know if I may have some conflict with anything here. I also installed the upgrade to the original contribution but I didn't like it, both gave me problems with the fields.

5) If I go into the PHP file myself, is there a code that I can add to get my MUPC's put on so that the tables can be organised by this so that customer order fullfillment could be easier?

6) One more thing...I use the same manufacturer for all of my products, is there any way I can make my storefront have a way customers can browse by Design Style instead of Browse by Manufacturer?
----------Does anyone have the code for doing this too?


I MUCH MUCH MUCH Appreciate any help that anyone can give me.

#56 datasmog

  • Community Member
  • 15 posts
  • Real Name:ray

Posted 10 April 2006, 11:49

View Postselmaboyd, on Apr 9 2006, 12:24 PM, said:

check your MySQL language. I found that these commands are sometimes different for languages...I had lang for MyPHP admin set at en-utf-8 and MySQL connection collation set to cp1251_Ukrainian_ci

:-"

Thanks for the response, but it's not the languaage.
This error is caused by the "Load Data Local" command and is a "Security Feature" in current versions of MySQL. It is possible to configure MySQL without this feature, but it is a default setting.
There are workarounds if you know how and can be bothered to faff around, but ask your hosting company to change the settings their end, it's simpler.

#57 thewrath1

  • Community Member
  • 59 posts
  • Real Name:Gaz

Posted 11 April 2006, 20:32

View Postselmaboyd, on Apr 9 2006, 08:29 PM, said:

I followed everything you said up until directions # 1 I am now totally lost.

Could you please ( or someone else if they have the time) explain to me:

1) what you mean by the "identifier" of the "products" table and how do I figure out what the identifier is?

2) Is the identifier generated by the computer or do I pick my own products id numbers and so on?

3) If my products have their own Manufacturers UPC information for identifying their products, how do I imput them?

4) One more thing, I installed the excel contribution so, I don't know if I may have some conflict with anything here. I also installed the upgrade to the original contribution but I didn't like it, both gave me problems with the fields.

5) If I go into the PHP file myself, is there a code that I can add to get my MUPC's put on so that the tables can be organised by this so that customer order fullfillment could be easier?

6) One more thing...I use the same manufacturer for all of my products, is there any way I can make my storefront have a way customers can browse by Design Style instead of Browse by Manufacturer?
----------Does anyone have the code for doing this too?
I MUCH MUCH MUCH Appreciate any help that anyone can give me.

1,2) The identifier is the row number, which is given to that row (ie: a row with a product) when inserting it into the db.
The row number, is unique, and increments by 1 automatically. It has to be unique.
If you keep inserting things into the db, the row number will just continue, unless you choose to replace the existing numbers.
When I export a table, I empty it, and when bringing it back i replace any existing, so the numbers always remain the same as they were.
3) The manufacturer id is a column in the product table, the number is referred to the manufacturer table values.
So if you change them in this column in products, they can be found on the site when looking at that particular manufacturer.
4) I cant speak for the Excel contrib, as I have never used it, never needed to. As I remember, Easy Populate is the same contrib, taken further, which is how EP began.
5) If you are looking to add an extra field for a Manufacturer code, you can do one of 2 things, either set it as a products attribute, or get someone or a contrib to help u add an extra column to the products table.
Im sure you will find this aleady done many times on the forum.
6) Again, this could be done 2 ways, either a complete duplicate of the way manufacturers work, except by style. Or, preferably, as a product attribute, which is what this was designed for.

You choose your styles, colours, finishes, and fill them at the time of enetering products.

These values can then be applied when searching through your products by visitors.

Hope this helps.

thewrath1
Q/ How many therapist's does it take to change a lightbulb?
A/ Two. But the lightbulb has to really 'want' to change.

#58 Challenged

  • Community Member
  • 2 posts
  • Real Name:Joanne

Posted 29 April 2006, 14:56

You guys are sensational! After pulling my hair out trying to get Easy Populate to work I came across this solution and I am forever in your debt.

Thanks for all your tips.

Jo

#59 matrix2223

  • Community Member
  • 859 posts
  • Real Name:Eric
  • Gender:Male
  • Location:MD USA

Posted 29 April 2006, 16:33

I read in this post somewhere about installing a new mysql database on your hosts server. My question is where do you get the latest version at.

I know this sounds like a nubie question

Thanks
Eric

Keep up on osCommerce changes and updates at Github | Understand osCommerce a little further at OsCommerce Documentation | Copy and paste your error message in Google add "in osCommerce" at the end to get relevant answers to most issues.


#60 kendrak

  • Community Member
  • 2 posts
  • Real Name:Stephanie
  • Location:Lyon - France

Posted 03 May 2006, 15:06

at first excuse my mistakes i'm french but I didn't found anything about my question into french forums.

So : i'm working on a database which present some products ( a lot of products ^^)
someone made an excel array with every datas i need so i export this file in CSV to import it in phpmyadmin.
but my problem is that the original file (.xsl) contain some special charts like " ' " or " é " and my database in phpmyadmin is in UTF8 : it means that it cuts some strigs when tere is some ' or other special charts... annoying ^^

how can i export my original file in CSV UTF8 ? is it possible ?
or simply : what can i do to conserv my special chart in final database ?

thanks a lot to everyone which will help me ^^