Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

The Database Forum


You are currently viewing our The Database Forum as a guest. Please register to participate.
Login



Reply
Excel CSV to phpMyAdmin
Old 06-04-2010, 12:45 PM Excel CSV to phpMyAdmin
WebTraffic's Avatar
Extreme Talker

Posts: 225
Name: Brandon
Trades: 0
Hello all,

First off, I have searched and searched for an answer trying to figure out how to do this and still nothing makes sense to me so I thought I would try describing my situation and seeing if anyone has an answer that I can understand.

I have a table in MySQL that I am trying to update. There are already values in the table and the primary key is products_id. There are 13 fields total in this table but I am only needing to update one of them, therefore in my spreadsheet I have the primary key (products_id) and the one I want to update (products_learnmore).

When I try to import the file as a CSV (comma delimited) I get the error:

Invalid field count in CSV input on line 1.

I'm guessing this means that it is expecting my csv file to have all 13 fields, I'm not sure though. Also, my products_learnmore field does contain commas, as it is HTML coding for product descriptions.

I have tried using csv2sql.com/ but cannot get it to work with importing SQL either. Does anyone have any ideas on how to solve this? There are about 600 products and it would take absolutely forever to edit 1 by 1

__________________

Please login or register to view this content. Registration is FREE

Coding is just like a woman. If you don't do something exactly right, it complains.
WebTraffic is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 06-04-2010, 03:57 PM Re: Excel CSV to phpMyAdmin
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,385
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
Quote:
field does contain commas
CSV means COMMA separated values.
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 06-04-2010, 04:37 PM Re: Excel CSV to phpMyAdmin
vangogh's Avatar
Post Impressionist

Latest Blog Post:
Why Responsive Design?
Posts: 10,815
Name: Steven Bradley
Location: Boulder, Colorado
Trades: 0
It is expecting all the extra fields. Why not export what you have in the database as a csv to get the full list and then merge the two csv files so you have all 13 fields with the one new field that needs to be updated.

Another option would be to turn your csv into sql. You'd need to turn your two fields (the one to update and the id field) into update statements

UPDATE tablename SET products_learnmore = value WHERE product_id = value;

I would think some general search and replace could take what you have and turn it into something along the lines of the update statement.
__________________
l Search Engine Friendly Web Design |
Please login or register to view this content. Registration is FREE

l Tips On Marketing, SEO, Design, and Development |
Please login or register to view this content. Registration is FREE

l
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE

Last edited by vangogh; 06-04-2010 at 04:41 PM..
vangogh is offline
Reply With Quote
View Public Profile Visit vangogh's homepage!
 
Reply     « Reply to Excel CSV to phpMyAdmin
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.12278 seconds with 12 queries