how can i use excel tables, put the data in arrays and then compare them

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • unlucky
    New Member
    • Apr 2010
    • 2

    #1

    how can i use excel tables, put the data in arrays and then compare them

    At the moment i have a system where i can upload several csv files onto my sql and comapre them. with the compared data i then apply some calculations with gives me a result.

    however i am told that i should'nt be using mysql for this and instead, put the lines of data of the csv/excal file in an array! there could be up to 100 lines. and then i should compare them that way producing another array of the compared data. then i should apply my calculations to that array. i am incredibly confused on how to implement this? is this even possible. also i only have a few days to do this!
  • code green
    Recognized Expert Top Contributor
    • Mar 2007
    • 1726

    #2
    i am told that i should'nt be using mysql for this and instead, put the lines of data of the csv/excal file in an array!
    This is a rather strange observation.
    I import orders from CSV into MySql, then read from MySql and perform calculations.
    Having the data in MySql gives me a record I can refer back to.
    It can also simplify the code for array manipulation by doing a lot of the work in the SELECT query.

    Yes it can be done purely by code with PHPs powerful file and array functions and if you don't need to keep this data it makes some sense.
    But to re-write something that works with a time constraint is unnescessary surely.
    However you may find fgetcsv() useful

    Comment

    • unlucky
      New Member
      • Apr 2010
      • 2

      #3
      no i dont have to store the data, jusst temporarily store it for the calculations.

      thanks for the answer btw!

      Comment

      Working...