Results 1 to 12 of 12
  1. #1
    Member bluewaves1's Avatar
    Join Date
    April 12th, 2007
    Location
    Utah
    Posts
    125
    Uploading Datafeed to MYSQL Database
    I've created the appropriate table structure for shareasale data uploads.
    I was successful at getting one datafeed into the database, but I didn't write down the exact steps I used, and it was over 6 months ago, so now I'm trying with a new database and am having difficulty.

    What I did that doesn't work:

    1. Downloaded the csv database from shareasale.
    2. Replaced userid with my number.
    3. Opened the file in Excel.
    4. Saved it as a csv file.
    5. Went to MySQL ADMIN and clicked on Import in the table I created for the new data base (copied the table structure of the one that worked).
    6. Clicked on Import.
    7. Selected file to import in a csv format.
    8. This is where I get confused...there are three choices csv, csv + load data and sql. I don't know which to choose.
    9. Then I don't know if the file I've saved now has the | delimiters or comma delimiters so I don't know what to change in the fields terminated by or any other choices in that column.

    Some of the choices I made resulted in uploading the file...but it only picked up the Product Id column and then stopped.

    I know this is pretty basic stuff that I don't understand. I hope someone will help me.

    Thanks.

  2. #2
    ABW Ambassador bettylou's Avatar
    Join Date
    December 27th, 2005
    Location
    Indiana
    Posts
    595
    Hi bluewaves,

    Question #8: You will need to select the csv format, because that is the format that you saved from excel in.

    Question #9: You have comma delimiters. csv stands for comma separated values.


    Let me know if this helps.

  3. #3
    Member bluewaves1's Avatar
    Join Date
    April 12th, 2007
    Location
    Utah
    Posts
    125
    Still no luck
    Do I just change the fields terminated by to a comma and leave the default for the rest of the fields?

    Fields terminated by
    Fields enclosed by
    Fields escaped by
    Lines terminated by

    **********************

    I keep getting this error message: Invalid field count in CSV input on line 17

  4. #4
    ABW Ambassador bettylou's Avatar
    Join Date
    December 27th, 2005
    Location
    Indiana
    Posts
    595
    Quote Originally Posted by bluewaves1
    Do I just change the fields terminated by to a comma and leave the default for the rest of the fields?

    Fields terminated by
    Fields enclosed by
    Fields escaped by
    Lines terminated by

    **********************

    I keep getting this error message: Invalid field count in CSV input on line 17

    You should be OK to just leave them at their defaults. The error you are getting means that the number of fields in your feed doesn't match the number in your database table. Even the blank fields in the data feed will count unless you delete them.

  5. #5
    Member bluewaves1's Avatar
    Join Date
    April 12th, 2007
    Location
    Utah
    Posts
    125
    Help
    It seems that when there are quotes in the description field...this messes things up. When I took the quotes out it helped..but then more errors appeared.

    I don't know why the field count would change from one entry to the next. Do you?

  6. #6
    ABW Ambassador bettylou's Avatar
    Join Date
    December 27th, 2005
    Location
    Indiana
    Posts
    595
    spelling
    If there are quotes in the description field, it will terminate that field string at the quote. For example:

    "sku", "name", "this product is the "best" by far", "price"

    The string will end at the first set of quotes before the word best. Then you are left with some extra stuff. This can throw off the entire import.

    Quotations within the description field (or any field) are a pain in the you know what for data feed folks. Automating feeds does help because you can escape them. For excel, try saving a csv version of the feed and empty the description field, this way you will know for sure that it is the description field giving you the troubles.

    Let me know what happens.

  7. #7
    ABW Ambassador writerguy's Avatar
    Join Date
    January 17th, 2005
    Location
    Springfield, Missouri, USA
    Posts
    3,248
    There are a couple of classic threads here on putting datafeeds into MySQL tables. Always glad when my "oldie" status around here pays off and I can point some of you "newbies" in the right direction.

    Try reading carefully through all of this thread:

    http://forum.abestweb.com/showthread.php?t=86606

    Several of us here use variously modified/tweaked versions of that script for virtually everything we do with SAS datafeeds.

    You also might want to go here to download a version of that same script which Sean, "mobilebadboy," created later.
    Generate more fake news.

  8. #8
    Member bluewaves1's Avatar
    Join Date
    April 12th, 2007
    Location
    Utah
    Posts
    125
    Still having problems
    I am getting an error message:

    Warning: fgetcsv() expects parameter 1 to be resource, boolean given in /home/voipvide/public_html/coolchecks/ftp/7669.php on line 56

    Warning: fclose(): supplied argument is not a valid stream resource in /home/voipvide/public_html/coolchecks/ftp/7669.php on line 84


    when I run his scripts. Any thoughts?

  9. #9
    ABW Ambassador bettylou's Avatar
    Join Date
    December 27th, 2005
    Location
    Indiana
    Posts
    595
    Verify that you have the right username and password for your ftp connection.

  10. #10
    ABW Ambassador PatrickAllmond's Avatar
    Join Date
    September 20th, 2005
    Location
    OKC
    Posts
    1,219
    fgetcsv() is the function that reads a line and turns it into an array. It expects that you have a properly opened file or it will not work.

    I don't believe you are opening your file correctly.

    http://us2.php.net/fgetcsv
    ---
    This response was masterly crafted via the fingers of Patrick Allmond who believe you should StopDoingNothing starting today.
    ---
    Focus Consulting is where I roll | Follow @patrickallmond on Twitter
    Search Engine Marketing | Search Engine Optimization | Social Media | Online Video

  11. #11
    ABW Veteran Mr. Sal's Avatar
    Join Date
    January 18th, 2005
    Posts
    6,795
    Quote Originally Posted by writerguy
    There are a couple of classic threads here on putting datafeeds into MySQL tables. Always glad when my "oldie" status around here pays off and I can point some of you "newbies" in the right direction.

    Try reading carefully through all of this thread:

    http://forum.abestweb.com/showthread.php?t=86606

    Several of us here use variously modified/tweaked versions of that script for virtually everything we do with SAS datafeeds.

    You also might want to go here to download a version of that same script which Sean, "mobilebadboy," created later.
    Hi Gary,

    You're doing a good job, I was about to post something similar but you beat me to it.

    But now that I have had the time to rethink about it, I would like to ask you a question!

    Haven't you noticed how some of these kind of replies usually go?

    Haven't you noticed that some of us like you and me, and just a few others are willing to handle the question from any new child about telling them the truth about from where we come from if they ask, and the answers by others that may just talk about the birds and the birds?

    I hope you do know what I mean, but if you don't understand this post, just PM me about it. Just make sure you don't play around with this issue with me, because I think you know me by now.

  12. #12
    ABW Ambassador writerguy's Avatar
    Join Date
    January 17th, 2005
    Location
    Springfield, Missouri, USA
    Posts
    3,248
    Quote Originally Posted by Mr. Sal
    Hi Gary,

    Haven't you noticed that some of us like you and me, and just a few others are willing to handle the question from any new child about telling them the truth about from where we come from if they ask, and the answers by others that may just talk about the birds and the birds?

    I hope you do know what I mean, but if you don't understand this post, just PM me about it. Just make sure you don't play around with this issue with me, because I think you know me by now.


    Mr. Sal, I love it. Yeah, but it's good that a few people -- like YOU, like Snib, like Mobilebadboy (haven't noticed him around for awhie?), bettylou, and several others -- are willing to help.

    I learned just about everything I have learned about PHP/MySQL from your patient "tutoring," Sal, and I appreciate that. And what you haven't taught me directly, you always motivated me to dig out answers when I could.

    Like I said, I don't consider myself knowing all that much, but I'm glad I can help sometimes with my small knowledge. And I always appreciate it when you post about these coding issues, too!

    To everyone else who does pitch in and help with this stuff, hooray for all of you! It's a great place for all of us to learn together and I know I really appreciate that.
    Generate more fake news.

  13. Newsletter Signup

+ Reply to Thread

Similar Threads

  1. So i've got the datafeed into mysql database..
    By chillini in forum Programming / Datafeeds / Tools
    Replies: 10
    Last Post: December 2nd, 2008, 02:06 PM
  2. Database Replication with mySQL
    By Snib in forum Programming / Datafeeds / Tools
    Replies: 10
    Last Post: September 8th, 2006, 01:24 AM
  3. Empty A MySQL Database Using PHP
    By AddHandler in forum Programming / Datafeeds / Tools
    Replies: 2
    Last Post: March 25th, 2006, 04:29 PM
  4. How can I use buyitbomb with Mysql database?
    By Amavisca in forum Programming / Datafeeds / Tools
    Replies: 0
    Last Post: July 6th, 2005, 06:43 AM
  5. MySQL database - Can I...
    By ~Michelle in forum Programming / Datafeeds / Tools
    Replies: 2
    Last Post: March 26th, 2004, 01:59 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •