Buying Need Php csv to mysql help! - I'm paying!

Discussion in 'Programming' started by workingsmart, Mar 20, 2013.

  1. #1
    Hey all DP'ers!!

    I have a csv file ( which will be anywhere from 1 to 50 columns ) and I've got the database all setup.

    I need to, via php -
    1. Loop through CSV and count the columns
    2. remove first row and load data into database table where columns have data
    3. I need another loop through the csv to get the column heads to print out as a table head where the column has data
    I've tried quite a few techniques that I found through searching and experimenting but can't seem to get this to work properly.

    I'm out of time and need a solution asap so I'm reaching out to you for help!

    I have cash in hand and will pay for this function.

    I don't use paypal anymore so any other payment method - I will setup or if you are US based and have a chase account I'll quickpay the cash right to you upon completion!

    Thanks!
     
    Last edited: Mar 20, 2013
    workingsmart, Mar 20, 2013 IP
  2. SoftwareTechService

    SoftwareTechService Member

    Messages:
    88
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    41
    As Seller:
    100% - 0
    As Buyer:
    100% - 0
    #2
    Hello,

    Please contact me and I will help you to make this PHP script.

    Skype: dyamar_eng

    Regards,
     
    SoftwareTechService, Mar 20, 2013 IP
  3. signorm68

    signorm68 Well-Known Member

    Messages:
    984
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    108
    As Seller:
    100% - 0
    As Buyer:
    100% - 0
    #3
    I have this code for passing various CSVs (usually product feeds) to mysql. First line are actually headlines, so you need them out and then one by one row to process in loop and add specified (or all) fileds into mysql...Drop pm
     
    signorm68, Mar 20, 2013 IP
  4. Sir-Mammad

    Sir-Mammad Active Member

    Messages:
    148
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    51
    As Seller:
    100% - 0
    As Buyer:
    100% - 0
    #4
    I can do it easily and fast !
    Send me sample and details
     
    Sir-Mammad, Mar 20, 2013 IP
  5. edduvs

    edduvs Well-Known Member

    Messages:
    394
    Likes Received:
    31
    Best Answers:
    3
    Trophy Points:
    160
    As Seller:
    100% - 2
    As Buyer:
    100% - 0
    #5
    Everybody trying to strip you off .. funny. However, your solution is simple, as my actual query is:

    LOAD DATA LOCAL INFILE 'imagesindex.csv'
    INTO TABLE images
    FIELDS TERMINATED BY ','
    OPTIONALLY ENCLOSED BY '"'
    LINES TERMINATED BY '\n'
    IGNORE 1 LINES
    (id,Dateline,ImagePath,Imageid)
    PHP:
     
    edduvs, Mar 20, 2013 IP
  6. signorm68

    signorm68 Well-Known Member

    Messages:
    984
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    108
    As Seller:
    100% - 0
    As Buyer:
    100% - 0
    #6

    Actually it is not so simple, for example you need to take care about duplicated rows, and some other stuffs so you can use just plain import to mysql.
     
    signorm68, Mar 21, 2013 IP
  7. edduvs

    edduvs Well-Known Member

    Messages:
    394
    Likes Received:
    31
    Best Answers:
    3
    Trophy Points:
    160
    As Seller:
    100% - 2
    As Buyer:
    100% - 0
    #7
    You can always have a trigger before insert mate.
     
    edduvs, Mar 21, 2013 IP